Skip to content

Example Roadmap

Examples are now grouped by documentation path. Public commands stay stable, such as cargo run --example counter; source files live under learning-path subdirectories and are explicitly registered with [[example]] entries in the root Cargo.toml.

Every important example should satisfy:

  • It can run independently with cargo run --example name.
  • It maps to a tutorial or component reference page.
  • It has a reproducible VHS tape.
  • Its recording output lives under docs/public/recordings/.
GroupPurposeExamples
startGetting started and core mental modelhello_world, counter
hooksState, effects, async dataasync_state, atom_state
coreComponent model, Element DSL, and macro syntaxcontrol_flow
routingShell, dynamic params, history, and page staterouter
inputInput layers, exclusivity, shortcutsinput_mutex
componentsOne page per built-in component, plus the theme demoinput, search_input, scrollview, wrapped_text, modal, confirm_modal, alert_modal, shortcut_info_modal, select, multi_select, tree_select, table, virtual_list, virtual_multi_select, theme
advancedCustom hooks, Providers, handwritten Components, native widget bridgescustom_widget, custom_hook, custom_provider
appsFull compositional demostodo_app

Cargo only auto-discovers top-level examples/name.rs or examples/name/main.rs. Examples inside grouping directories must be explicitly registered in the root Cargo.toml:

[[example]]
name = "counter"
path = "examples/start/counter.rs"

When adding a new example, update the docs page and VHS tape at the same time so documentation does not drift from runnable code.

The old list / custom_list examples have been removed: ordinary selection is covered by Select / MultiSelect / VirtualList, and native ratatui widget bridging is covered by custom_widget.

DirectoryExamplesStatus
examples/start/hello_world, counterRegistered in Cargo.toml
examples/hooks/async_state, atom_stateRegistered in Cargo.toml
examples/core/control_flowRegistered in Cargo.toml
examples/routing/routerRegistered in Cargo.toml
examples/input/input_mutexRegistered in Cargo.toml
examples/components/input, search_input, scrollview, wrapped_text, modal, confirm_modal, alert_modal, shortcut_info_modal, select, multi_select, tree_select, table, virtual_list, virtual_multi_select, themeRegistered in Cargo.toml
examples/advanced/custom_widget, custom_hook, custom_providerRegistered in Cargo.toml
examples/apps/todo_appRegistered in Cargo.toml
ExampleDocsRecording
hello_worldQuick Startdocs/tapes/hello-world.tape
counterCounter Tutorialdocs/tapes/counter.tape
async_stateAsync Data Statesdocs/tapes/async-state.tape
atom_stateAtom Global Statedocs/tapes/atom-state.tape
control_flowControl Flow Syntaxdocs/tapes/control-flow.tape
input_mutexInput Mutexdocs/tapes/input_mutex.tape
scrollviewScrollViewdocs/tapes/scrollview.tape
wrapped_textWrappedTextdocs/tapes/wrapped-text.tape
inputInputdocs/tapes/input.tape
search_inputSearchInputdocs/tapes/search-input.tape
modalModaldocs/tapes/modal.tape
confirm_modalConfirmModaldocs/tapes/confirm-modal.tape
alert_modalAlertModaldocs/tapes/alert-modal.tape
shortcut_info_modalShortcutInfoModaldocs/tapes/shortcut-info-modal.tape
routerRouter Workbenchdocs/tapes/router.tape
selectSelectdocs/tapes/select.tape
multi_selectMultiSelectdocs/tapes/multi-select.tape
tree_selectTreeSelectdocs/tapes/tree-select.tape
tableTabledocs/tapes/table.tape
virtual_listVirtualListdocs/tapes/virtual-list.tape
virtual_multi_selectVirtual Multi Selectdocs/tapes/virtual-multi-select.tape
todo_appTodo Appdocs/tapes/todo-app.tape
custom_widgetNative Widget Bridgingdocs/tapes/custom-widget.tape
custom_hookCustom Hookdocs/tapes/custom-hook.tape
custom_providerCustom Providerdocs/tapes/custom-provider.tape