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
Wunderbaum tree — minimal

The smallest nested tree, hosted in a Panelini card.

Wunderbaum tree inside panelini
Wunderbaum treegrid — columns

Switch to tree + table mode with per-node column values.

Wunderbaum treegrid — columns
Checkbox tree

Hierarchical checkboxes with tri-state parent propagation.

Checkbox tree — hierarchical selection
Context menu

Right-click a node to add, rename, or delete via a callback.

Context menu — right-click actions
Lazy loading

Load children on demand when a lazy node is expanded.

Lazy loading — children on demand
Incremental tree updates

Build a folder structure step by step with action playbooks.

Incremental updates — build a tree step by step
DAG projection

Project a graph of SubClassOf / HasPart edges into a treegrid.

DAG projection — graph as a tree
Virtual filesystem

The full demo — columns, DnD, context menu, rename, file drop.

Virtual filesystem — the full demo

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.