Skip to content

Examples

Three apps in the box.

Each example is a standalone cargo project under examples/ in the repo. Clone, run, read, fork.

examples/default TUI screenshot
basic no features

examples/default

A multi-page app with a focusable list, page navigation, and quit. The minimal end-to-end example — the one to read first to understand the architecture.

Run it

cargo run --example default

What it shows

  • Multi-page routing with register_page
  • Focus list with movement (j k)
  • Default keymaps in action
  • Clean Runtime::run() loop
Read source
examples/canvas TUI screenshot
canvas +ratatui

examples/canvas

A login form with validated inputs, a submit button, and a canvas-owned keymap. Demonstrates the canvas feature flag: GUI renderers, suggestions, cursor style, validation, computed fields, textareas, and text inputs.

Run it

cargo run --example canvas --features canvas

What it shows

  • Field-level focus with tab / shift+tab
  • Cursor style + blinking caret from canvas
  • Submit button as a focusable element
  • Validation wiring (sketch in examples/canvas)
Read source
examples/keybindings TUI screenshot
dialog +ratatui

examples/keybindings

A modal showing all keybindings, opened with ?. Demonstrates the built-in dialog feature: content and result types, plus a ratatui renderer.

Run it

cargo run --example keybindings --features dialog

What it shows

  • Modal lifecycle: open, focus, close
  • Background app dimmed behind the modal
  • Custom keymaps rendered with the kbd widget
  • Dialog::Keybindings content type
Read source

Build your own.

The book walks you from cargo new to a working multi-page app. Or read the API reference and dive in.