Skip to content

Example Catalog

All examples live in examples/ and can be run with:

bash
cargo run --example <name>

Web/WASM examples live under examples/web/ and are standalone crates:

  • examples/web/hello
  • examples/web/search_palette

Feature-gated examples require --features:

bash
cargo run --example image --features image
cargo run --example markdown_editor_sync --features markdown,syntax-syntect

Getting Started

ExampleDescription
todoClassic todo app: text input, add, toggle, scroll, delete confirmation
dashboardMulti-panel dashboard: Grid, Sparkline, StatusBar, Badge
formsForm patterns: Radio, Select, ComboBox, Slider, DatePicker
form_validationLogin-style validation: Validator, Input::error(...), Enter-to-submit
mockupDashboard-style layout prototyping with mockup! (no Component code)
ui_snapshotAgent-oriented UI snapshot export via TestBackend::capture_ui_snapshot()
network_client_sketchDesign-first Mockup sketch for a TUI Postman/Insomnia-style HTTP + GraphQL client; writes markdown plus font-backed PNG variants with ui-snapshot-png
lazygitLazygit-style multi-panel layout with focus hints and number-key switching
showcaseBroad demo: tabs, accordion, fuzzy palette, context menu, tree, toast, tooltip
whack_a_moleWhack-a-mole arcade (terminal); same layout and rules as the WASM showcase tab

Layout & Containers

ExampleDescription
length_percentLength::Percent for horizontal and vertical sizing
frame_hubFrame demos hub: border merge, decorations, and divider/tab features
splitterSplitter classic vs frame-join modes with resizable panes
window_managerHyprland-style tiling/floating window manager showcase with Canvas, Transition<FloatRect> geometry, workspaces, hover/framework focus integration, animated focus chrome, Alt-only keybindings, fullscreen, configurable title/focus/animation policy, smart local split-axis toggles, animated tiled drag/drop reflow, remembered floating geometry, position-aware float-to-tile toggles, persistent dwindle-tree target splitting for tiled windows, and corner-aware resize
modal_auto_heightModal + List with Auto vs max_height constraints
modal_percent_reproModal height percent and OverlayScope behavior
mouse_region_clickMouseRegion: passthrough vs capturing button/region clicks

Input Widgets

ExampleDescription
inputsSingle-line and multi-line inputs: username, password, search, bio
drag_drop_kanbanGeneric DragSource / DropTarget kanban board with preview and cancel
text_areaTextArea editor paired with read-only viewer: scroll, selection, line numbers, Vim modal editing
text_area_sentinelsTextArea sentinels: @ file picker tokens, stash/restore snapshots
text_area_virtual_textTextArea virtual text: inline inlay hints and end-of-line diagnostics absent from the buffer
multi_selectMultiSelect: space toggle, enter commit
hex_areaHexArea: binary editing, cursor, selection, scroll

Data Widgets

ExampleDescription
tableTable: header, rows, selection, scroll + inspector preset (tabs, sections, key/value, disclosure)
list_headersList with section headers and spacers
log_viewerLogView over a sample file: filter, follow, pause, level coloring

Tabs & Navigation

ExampleDescription
tabs_hubTabs demos hub: TabVariant styles + draggable tab bar behaviors
pagination_composedComposed pagination controls with page-size dropdown

Search & Overlays

ExampleDescription
search_palette_hubSearchPalette hub: uncontrolled, controlled, delete-confirm, description placement, popover overlays
command_paletteCommandPalette + command registry demo: open with p, app and child commands
search_listsGlobal / search plus per-panel filters over files, branches, tasks

Display & Visualization

ExampleDescription
ascii_canvas_ghostASCII ghost animation using AsciiCanvas with frame sequences
ascii_canvas_scrollAsciiCanvas inside ScrollView: row-skip clipping and gradient rendering
animated_showcaseAnimated opacity, height, and keyed position transitions with easing/duration controls
animated_sequential_swapSequential fade between subtrees via on_opacity_transition_end (fg+bg, fg-only, framed)
chart_showcaseChart with multiple series, thresholds, axes, legend, grid
diagram_showcaseTabbed diagram hub covering SequenceDiagram, ClassDiagram, ErDiagram, StateDiagram, and GanttDiagram examples
flowchart_showcaseFlowchart with branching, cycles, dashed/thick edges, nested subgraphs, class styles, and item callbacks
graph_showcaseScrollable Graph layouts with compact and rounded node/edge variants, clickable nodes, hover styling, and path status
pan_viewPanView with a centered clickable Graph: bounded free panning, arrow/hjkl controls, and animated reset-to-center
sparkline_showcaseAnimated Sparkline samples (CPU-like usage, download/upload)
heatmapHeatmap-style grid with color gradients
progress_zonesSeveral ProgressBar styles/zones (CPU, memory, disk, network)
visual_effectsEffectScope post-processing: monochrome, palettes, scanlines, rainbow, CRT presets
effects_ripplePhase-owned ripple effects: looping background wave plus one-shot burst

Styling & Themes

ExampleDescription
theme_showcaseThemeProvider and switchable built-in themes
live_host_colorsRunner-managed host terminal color refresh for app-owned system theme tokens
alpha_foreground_backdropRepro for alpha foreground blending against parent backgrounds vs terminal fallback
color_contrastAutomatic text readability on varied backgrounds
gradient_widgetsGradient-themed ProgressBar, Slider, Table, SearchPalette
hoverHover styles across interactive widgets

Inline Mode

ExampleDescription
inlineInline viewport: draft input and ctx.append_transcript_lines rich log lines
native_scroll_chatClaude Code / Gemini CLI style transcript using ctx.append_transcript_element + native scrollback
inline_choicesInline theme/target pickers and apply-to-insert summary
inline_list_pickerInline list picker over command list

ScrollView

ExampleDescription
scroll_view_scroll_to_keyScrollView + smooth scroll_to_key: search jumps to matching keyed message
scroll_view_both_axesScrollView with ScrollAxis::Both: vertical + horizontal pan and scrollbars
smooth_scroll_targetsDistance-adaptive smooth target scrolling across ScrollView, DocumentView, and TextArea with user-cancel behavior
scroll_view_stressStress: many Frame + DocumentView children (FPS)
scroll_view_opencode_reproOpencode-like session: sidebar, timeline, search/theme overlays

Diagnostics & Stress Tests

ExampleDescription
diagnosticsRender/mouse diagnostics hub: active, idle, and tabbed behavior metrics
stress_testLarge list + text field + optional FPS overlay
widget_galleryBuilt-in widgets: checkboxes, progress bars, spinners, sliders
widgetsFilterable demo: tabs, list, table, scroll, border toggles
auto_height_testTextArea + DocumentView with Length::Auto height behavior

Feature-Gated Examples

big-text

ExampleDescription
big_textBigText: FIGlet fonts, horizontal/vertical/rainbow gradients
figlet_editorFIGlet editor: per-character glyphs, font selection, import/export
bash
cargo run --example big_text --features big-text
cargo run --example figlet_editor --features big-text

diff-view

ExampleDescription
diff_hubDiffView hub: before/after compare and patch-based unified/split modes
diff_hunk_navigationGlobal hunk navigation across one auto-height patch-backed DiffView per file inside a keyed ScrollView
bash
cargo run --example diff_hub --features diff-view
cargo run --example diff_hunk_navigation --features diff-view

image

ExampleDescription
imageImage widget: procedural PNG, GIF, playback controls
image_modesTextArea inline image sentinels vs attachment mode
messengerChat UI with plain/rich messages and optional images
bash
cargo run --example image --features image
cargo run --example image_modes --features image
cargo run --example messenger --features image

markdown

ExampleDescription
markdown_hubMarkdown hub: preview, table rendering options, and hyperlink handling
document_view_mermaidMarkdown DocumentView rendering Mermaid fenced blocks, including Gantt schedules, for supported diagram types
scroll_view_stressStress: Frame + DocumentView children in ScrollView
scroll_view_opencode_reproOpencode-like session with sidebar and overlays
bash
cargo run --example markdown_hub --features markdown
cargo run --example document_view_mermaid --features markdown

markdown + syntax-syntect

ExampleDescription
markdown_editor_syncLive markdown editor + preview with bidirectional scroll sync
bash
cargo run --example markdown_editor_sync --features markdown,syntax-syntect

syntax-syntect

ExampleDescription
syntax_theme_compareSide-by-side syntax highlighting themes
bash
cargo run --example syntax_theme_compare --features syntax-syntect

terminal

ExampleDescription
terminal_filetree_devtoolsFileTree + ManagedTerminal devtools split
bash
cargo run --example terminal_filetree_devtools --features terminal

devtools

ExampleDescription
devtoolsMinimal app that emits periodic debug_log! lines for the DevTools logs tab
bash
cargo run --example devtools --features devtools

MIT OR Apache-2.0