# trame > trame is a Python framework for building reactive web applications and dashboards for scientific visualization, entirely from Python — no HTML/JS/CSS required. A trame app is a normal Python process (the "server") that shares a key-value **state** with a Vue-based web client; UI components (Vuetify, VTK, ParaView, Plotly, deck.gl, ...) re-render automatically whenever that shared state changes, and Python functions can be bound to UI events (clicks, slider drags, ...) the same way. The current major version is **v3**. Always generate v3-style code unless the user explicitly asks for v1/v2: - Base class: `from trame.app import TrameApp`, then `class App(TrameApp): def __init__(self, server=None): super().__init__(server); self._build_ui()`. Inside the class, `self.server`, `self.state`, `self.ctrl` are available after `super().__init__()`. - UI: `from trame.ui.vuetify3 import SinglePageLayout` (or `VAppLayout`, `SinglePageWithDrawerLayout`, or `trame.ui.html.DivLayout` for a bare page). - Widgets: `from trame.widgets import vuetify3 as v3` for Vuetify components; other integrations live in their own `trame.widgets.` package (see Widgets link below) and must be installed separately, e.g. `pip install trame-vtk`. - Method/state binding: use decorators from `trame.decorators` (`@change("var_name")`, `@controller.set("name")`, `@life_cycle.server_ready`) on methods of the `TrameApp` subclass, rather than free functions bound via `get_server()` (that pattern still works but is the older, more verbose v1-era style — prefer decorators for new code). - Do **not** use `from trame.html import ...` — that namespace was removed. Do **not** default to `client_type="vue2"` or `trame.ui.vuetify` (no `3` suffix) unless the user is working on a legacy v2 codebase. Minimal runnable skeleton (verify `pip install trame trame-vuetify` first): ```python from trame.app import TrameApp from trame.ui.vuetify3 import SinglePageLayout from trame.widgets import vuetify3 as v3 class App(TrameApp): def __init__(self, server=None): super().__init__(server) self._build_ui() def _build_ui(self): with SinglePageLayout(self.server) as self.ui: self.ui.title.set_text("Hello trame") with self.ui.content: v3.VContainer("Hello trame") def main(): app = App() app.server.start() if __name__ == "__main__": main() ``` ## Start here - [How to use trame](https://raw.githubusercontent.com/Kitware/trame/master/docs/vitepress/guide/intro/getting_started.md): Core concepts and API — shared state, method/event binding, layouts, HTML-attribute translation, CLI arguments, starting the server. Read this first. - [Cheatsheet](https://raw.githubusercontent.com/Kitware/trame/master/docs/vitepress/guide/intro/cheatsheet.md): Condensed syntax reference (state read/write, `@state.change`, method binding, controller, life cycle events) plus a complete <45-line working app. - [Cheatsheet reference app source](https://raw.githubusercontent.com/Kitware/trame/master/examples/06_vtk/00_ClientOnly/cheatsheet.py): The actual runnable file behind the cheatsheet — a verified, current v3/`TrameApp` pattern combining a Vuetify toolbar with a local VTK cone view. Good template to copy from. - [Known available widgets](https://raw.githubusercontent.com/Kitware/trame/master/docs/vitepress/guide/intro/widgets.md): Table of every widget package (pip name, import name, supported Vue version, component count). Check this before importing a widget to get the right package and import path — don't guess. - [Tutorial](https://raw.githubusercontent.com/Kitware/trame/master/docs/vitepress/guide/tutorial/index.md): Step-by-step build of a full VTK application: setup, layouts, HTML elements, application structure, ParaView. Each chapter's code is v3/current. ## ParaView - [ParaView cone (v3, current)](https://raw.githubusercontent.com/Kitware/trame/master/examples/07_paraview/Docker/SimpleCone.py): Verified current-API pattern for driving `paraview.simple` from a `TrameApp` with remote rendering (`trame.widgets.paraview.VtkRemoteView`). Use this as the template for ParaView integrations, not the other files under `examples/07_paraview/`, several of which still use the deprecated v2 API (`client_type="vue2"`, `trame.ui.vuetify`). - [ParaView tutorial chapter](https://raw.githubusercontent.com/Kitware/trame/master/docs/vitepress/guide/tutorial/paraview.md): Loading state files, CLI arguments, view binding — narrative walkthrough, v3. ## Reference - [API reference](https://trame.readthedocs.io/en/latest/index.html): Full autogenerated reference for `trame.app`, `trame.widgets`, `trame.ui`, `trame.decorators`, `trame.assets`, `trame.env`, plus Core Classes and Tools. - [Deployment: Python CLI/packaging](https://raw.githubusercontent.com/Kitware/trame/master/docs/vitepress/guide/deployment/pypi.md): Packaging an app for `pip`/PyPI distribution. - [Deployment: Docker](https://raw.githubusercontent.com/Kitware/trame/master/docs/vitepress/guide/deployment/docker.md): Containerizing a trame app. - [Jupyter integration](https://raw.githubusercontent.com/Kitware/trame/master/docs/vitepress/guide/jupyter/intro.md): Embedding a trame app inside a Jupyter notebook/lab cell. - [Examples gallery](https://kitware.github.io/trame/examples/): Browsable index of runnable example applications (VTK, ParaView, charts, GIS, real-world apps) with source links. Prefer fetching the linked `.py` source over the rendered page for code. ## Common pitfalls - Mutating a list/dict already stored in shared state in place does not trigger a UI update on its own — call `state.dirty("var_name")` after the mutation (or reassign the whole value). - Inside an `async` task/coroutine, wrap state writes in `with state:` so changes are flushed when the block exits. - A trame application should mount exactly one layout (one `VApp`) per page/process. - `v_model=("name", default)` sets an initial value and creates a two-way binding; `value=("js_expression",)` (no default) evaluates a JS expression instead — don't confuse the two. - Many integration examples in this repository's `examples/` directory predate the v3/`TrameApp` convention and still show v1/v2 patterns (`trame.html`, `client_type="vue2"`, `trame.ui.vuetify` without a `3` suffix). When copying from an example, check its imports before treating it as current best practice. ## Optional - [Blog](https://kitware.github.io/trame/blogs/): Announcements and deep dives on specific integrations (VTK-WASM, Catalyst, 3D Slicer, ...) — useful for background on one integration, not for general API patterns. - [v2 to v3 migration guide](https://raw.githubusercontent.com/Kitware/trame/master/docs/vitepress/guide/versions/trame_v2-3.md): What changed between v2 and v3 — relevant only when working with or migrating legacy code. - [Citing trame](https://raw.githubusercontent.com/Kitware/trame/master/docs/vitepress/guide/intro/citing.md): BibTeX entry, for academic use.