Runnable Demos
The repository’s demo/ crate ships ten runnable native GPUI applications pinned against the verified GPUI Kit dependency set. Start with starter or counter to learn a single concept, or launch incident_console to study a complete multi-pane desktop app.
Run Any Demo
Section titled “Run Any Demo”Run from the repository root (replace counter with any binary name below):
cargo run --manifest-path demo/Cargo.toml --bin counter --lockedThe demo crate pins Rust
1.98.1. Install your platform’s native graphics dependencies first—see Compatibility.
Demo Catalog
Section titled “Demo Catalog”| Binary | Level | What to try | APIs demonstrated |
|---|---|---|---|
starter |
Beginner | Run the minimal counter from the README | Minimal app bootstrap, native Button, rsx_listener! |
hello |
Beginner | Open a clean single-panel view | Static RSX, semantic theme colors, explicit pixel spacing |
counter |
Beginner | Increment, decrement, and reset state | rsx_listener!, rsx_update!, conditional classes, disabled Button |
palette |
Beginner | Compare color swatches and class names | Dynamic class expressions and color utilities |
task_list |
Intermediate | Complete and reopen individual tasks | Keyed stateful loops, captured IDs, derived counts |
component |
Intermediate | Type into inputs and open popovers | Kit Button / Input / Popover, #[component], child props |
syntax_gallery |
Intermediate | Toggle conditions, reverse rows, and scroll | Fragments, spread, keyed loops, state variants, negative margins, <svg> / <img> / <canvas> |
api_surface |
Intermediate | Toggle conditional styles and hover groups | Flex aliases, accessibility attributes, tooltips, group states |
project_dashboard |
Advanced | Filter work, adjust density, add follow-ups | Shared rsx.toml tokens, selection reconciliation, empty-state recovery |
incident_console |
Advanced | Filter 100k rows, assign owners, inject signals | Modular panels, <uniform_list>, shared dynamic runtime, event timeline |
Highlights in demo/
Section titled “Highlights in demo/”- State helpers (
counter): Usesrsx_listener!(cx, notify, ...)for single-step updates andrsx_update!when grouping state changes into one notification. Directcx.listener(...)callbacks remain supported everywhere. - Shared tokens (
demo/rsx.toml): Enables thegpui-componenttheme preset anddynamic-runtime = "rsx_runtime". Small demos use semantic theme classes, whileproject_dashboardandincident_consoleshare custom project tokens. - Negative margins (
syntax_gallery): Shows overlapping avatars with negative margin classes andrsx_fragment!spread children.
Headless Tests & Contracts
Section titled “Headless Tests & Contracts”Verify layout, element identity, callbacks, and rejected syntax without opening desktop windows:
cargo +1.98.1 test --manifest-path demo/Cargo.toml --lib --bins --tests --lockedcargo +1.98.1 test --manifest-path demo/Cargo.toml --doc --locked
api_contract,generated_api_contract, andsemantics_contractare compile-time contract binaries rather than interactive GUI apps.
For fast rebuild/restart loops during UI iteration, see Measure development reloads.