Introduction
Build complex web applications in Python—control panels, internal tools, data-intensive interfaces—without the frontend plumbing.
What is Trellis?
Trellis is a Python framework for building web applications. You write functions that describe what your UI should look like. The framework handles rendering, state management, and browser communication. When state changes, only affected components re-render—no manual wiring, no full-page refreshes. You work entirely in Python; there's no JavaScript to write, no templates, no REST API plumbing.
Why another framework?
Dashboard frameworks like Streamlit and Gradio made Python UI development accessible—simple scripts become interactive apps in minutes. But they hit limits quickly. Performance degrades, state becomes tangled, and what started simple becomes painful to maintain.
Traditional web development—React frontend, REST API—scales well and produces maintainable code. But you spend a lot of time on plumbing that has nothing to do with your actual problem.
Trellis aims for both: simple to start, maintainable as applications grow.
Try It
from trellis import component, state_var
from trellis import widgets as w
@component
def Counter():
count = state_var(0)
def decrement():
nonlocal count
count -= 1
def increment():
nonlocal count
count += 1
with w.Column(padding=20):
w.Heading(text="Trellis Counter")
w.Label(text=f"Count: {count}")
with w.Row():
w.Button(text="-", on_click=decrement)
w.Button(text="+", on_click=increment)
App = Counter
Features
- Declarative UI in Python —
@componentfunctions with context-manager syntax. No templates, no separate frontend language. - Reactive state — Automatic dependency tracking. Components re-render when dependencies change.
- Fine-grained updates — Only affected components re-render.
- Dark mode — System theme detection with light/dark toggle. Theme tokens for consistent styling.
- Three platforms — Server (web app), Desktop (PyTauri), Browser (Pyodide). Same codebase, each adapts to platform strengths.
- Type-safe throughout — Full type hints. IDE autocompletion works.
- Widget toolkit — Layout, forms, data display, charts, navigation. Full HTML support when you need lower-level control.
Use Cases
Good for:
- Instrument control applications—hardware interfaces, data capture
- Internal tools and developer interfaces—remote access, rapid development
- Line-of-business apps—workflows, data entry, admin panels
Not for:
- Mobile apps or slow networks
- Marketing sites or static content
- High-traffic public applications
Implementation Status
Early development — The API is unstable and may change significantly, including the widget framework.
Status: ✅ implemented · 🚧 partial · ❌ not yet
| Feature | |
|---|---|
| ✅ | Core rendering and reconciliation |
| ✅ | Reactive state with dependency tracking |
| ✅ | Server platform |
| ✅ | Browser platform (Pyodide) |
| ✅ | Desktop platform (PyTauri) |
| ✅ | HTML elements |
| ✅ | Type safety |
| 🚧 | Widget toolkit |
| ✅ | Partial updates (diff patches) |
| ✅ | Bidirectional binding (mutable()) |
| ❌ | Routing |
| ✅ | Hot reload |
Widgets
Prototype toolkit — The widget library exists to build applications complex enough to test the core framework. The API will change significantly.
Widgets are accessed via trellis.widgets (conventionally imported as w):
| Category | Widgets |
|---|---|
| Layout | Column, Row, Card |
| Forms | Button, TextInput, NumberInput, Checkbox, Slider, Select |
| Text | Label, Heading, Divider |
| Data | Table, Stat, Tag, Badge |
| Charts | TimeSeriesChart, LineChart, BarChart, AreaChart, PieChart, Sparkline |
| Feedback | ProgressBar, StatusIndicator, Tooltip, Callout, Collapsible |
| Navigation | Tabs/Tab, Breadcrumb, Tree, Menu/MenuItem, Toolbar |
| Icons | Icon (800+ Lucide icons) |
All widgets support React Aria for accessibility (keyboard navigation, focus management, ARIA attributes).
Next Steps
- Quickstart — Install Trellis and build your first app
- Theming — Dark mode, theme tokens, and styling
- Design Overview — Architecture and design decisions