Examples

Every example lives in examples/ in the repository. This section walks through each one, explains what it demonstrates, and shows how it’s covered by the test suite.

At a glance

AI chat — minimal

Drop an LLM chat into a Panelini dashboard with one flag.

Minimal AI chat
AI chat — custom tool

Hook a LangChain BaseTool (a local key–value store) into the chat.

AI chat with a custom tool
AI chat — multi-tab

Host two independent chats in synced tabs with jslink.

Multi-tab AI chats
JSON editor

Render a JSON-Schema driven form inside a Panelini card.

JSON editor inside panelini
Pydantic-backed JSON editor

Drive a JSON editor from a Pydantic model — schema and initial value derived automatically.

Pydantic-backed JSON editor
VisNetwork graph

Interactive network graph with vis-network + Vue.

VisNetwork graph inside panelini

Running the examples

# Clone the repo
git clone https://github.com/opensemanticworld/panelini.git
cd panelini
uv sync

# Run any example
python examples/panels/ai/chat_min.py
python examples/panels/jsoneditor/jsoneditor_panelini_min.py
python examples/panels/visnetwork/visnetwork_panelini_min.py

Each example ends with pn.serve(...) when run directly — just open the URL printed in the terminal.

Tested end-to-end

Every example under examples/panels/ is exercised by a Playwright test that imports the real module and asserts on rendered DOM. If an example breaks, the corresponding test fails — see tests/panels/*/examples/.

Run them locally:

make test-ui         # UI tests only
make test-full       # unit + UI

With background images disabled globally in tests/conftest.py, the full UI suite completes in ~43 s.