Skip to content

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 from the repository root (replace counter with any binary name below):

Terminal window
cargo run --manifest-path demo/Cargo.toml --bin counter --locked

The demo crate pins Rust 1.98.1. Install your platform’s native graphics dependencies first—see Compatibility.

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
  • State helpers (counter): Uses rsx_listener!(cx, notify, ...) for single-step updates and rsx_update! when grouping state changes into one notification. Direct cx.listener(...) callbacks remain supported everywhere.
  • Shared tokens (demo/rsx.toml): Enables the gpui-component theme preset and dynamic-runtime = "rsx_runtime". Small demos use semantic theme classes, while project_dashboard and incident_console share custom project tokens.
  • Negative margins (syntax_gallery): Shows overlapping avatars with negative margin classes and rsx_fragment! spread children.

Verify layout, element identity, callbacks, and rejected syntax without opening desktop windows:

Terminal window
cargo +1.98.1 test --manifest-path demo/Cargo.toml --lib --bins --tests --locked
cargo +1.98.1 test --manifest-path demo/Cargo.toml --doc --locked

api_contract, generated_api_contract, and semantics_contract are compile-time contract binaries rather than interactive GUI apps.

For fast rebuild/restart loops during UI iteration, see Measure development reloads.