Skip to content

Demos

Every demo in the repository runs in your terminal and in the browser from the same source. Clone the repository and run any of them by name:

sh
git clone https://github.com/kristoferlund/ratcn
cd ratcn
cargo run -p ledger93

The live previews on the component pages are these same demos, compiled to WebAssembly.

Full applications

Start here if you want to see how the pieces fit together at real size. Both are worth reading as source, not just running.

DemoShows
ledger93A nineties double-entry bookkeeping terminal. The largest example: several screens, per-screen state and messages, dialogs, and a keyboard-first workflow.
landingA responsive grid of live components, and how one app splits state and messages across independent tiles. This is the demo embedded on the home page.
wizardA four-step wizard that walks through starting a ratcn app. Buttons that move between steps, a select and a list that record choices, and one screen module per step. This is the demo embedded on Getting started.

Patterns

Each of these shows one technique end to end.

DemoShows
kanbanDrag and drop between columns, with cards keeping their identity as they move. See Dragging.
dragThe smallest possible drag: one block, moved anywhere inside the frame.
panelsTwo focusable panels, each grouping its own children — scopes and Tab boundaries. See Structuring a larger app.
effectsFetching data without blocking the UI, and feeding the result back in as a message. See State and messages.

Components

One demo per feature, so a docs page can show several side by side. These are the previews embedded on the component pages.

ComponentDemos
Buttonbutton-small, button-large — the five variants at each size
Listlist (cursor and selection kept separate), list-multi (checkbox multi-selection), list-people (two-line custom rows)
Selectselect — the dropdown panel
Tabstabs-basic (manual activation), tabs-automatic (focus selects), tabs-disabled (skipped by traversal), tabs-large
Dialogdialog — a modal layer with actions, draggable by its border
Toasttoast — transient notifications your app owns
Tooltiptooltip — hover or Tab to a button and its bubble floats above
BarChartbarchart, barchart-horizontal — a paint-only widget, no runtime needed

Running them in the browser

The demos are also the source of the previews on this site. Building them needs Trunk:

sh
cd demos/ledger93
trunk serve

Each demo's Cargo.toml selects crossterm when built natively and ratzilla when built for wasm32, so the same main.rs covers both. See Host integration for how that wiring works.