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
todo_uiSame todo app expressed with the ui! macro instead of rsx!
dashboardMulti-panel dashboard: Grid, Sparkline, StatusBar, Badge
process_monitorDense process inspector with metric cards, selectable process table, memory chart, and command bar
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()
sketchesKept design sketches driven by Sketch; run all with cargo snap sketches, or one with cargo snap sketches -- login
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
opencode_homeOpencode-inspired home shell layout
tui-lipanBraille logo showcase with Hero/Void/Neon/CRT/Quad visual modes

Layout & Containers

ExampleDescription
length_percentLength::Percent for horizontal and vertical sizing
grid_basicGrid: column/row tracks, auto-flow, gap, and spanning cells
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
exit_animationKeyed ExitQueue state retaining removed rows through Animated exits
auto_exitAutomatic exit animations via Animated::auto_exit, with no app-side removal bookkeeping
powerline_barBadge cap styles and neighbor-background threading for compact segment chains
flow_badgesFlow chip/badge wrapping
context_providerContextProvider DI example

Input Widgets

ExampleDescription
inputsSingle-line and multi-line inputs: username, password, search, bio
drag_drop_kanbanGeneric DragSource / DropTarget kanban board with preview and cancel
sidebar_tabsRich vertical sidebar tabs composed from primitives: label + description + status spinner per item, drag to reorder with insertion indicator
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
provided_file_treeAsync application-provided FileTree listings with loading, Git, and ignore metadata

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
effect_scope_dot_fieldTabbed full-screen custom EffectScope shaders: neon bloom, veiled lights, ember drift, hearth glow

Styling & Themes

ExampleDescription
theme_showcaseThemeProvider and switchable built-in themes
live_host_colorsApp::system_theme() plus runner-managed host terminal color refresh for app-owned 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
inline_auto_heightInline viewport auto-height behavior
inline_autowrapInline viewport autowrap behavior

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
ansi_passthroughRender styled text from raw ANSI escape strings
ascii_canvas_exporterMaterialize AsciiCanvas art + effects into FrameSequence JSON
paintBraille paint canvas demo
theme_auditRender a console UI across built-in theme presets for visual audit
theme_tokensShowcase syntax/diff/markdown theme token palettes
transition_colorProperty-scoped ctx.transition(...) color/value interpolation

Feature-Gated Examples

big-text

ExampleDescription
big_textBigText: FIGlet fonts, horizontal/vertical/rainbow gradients
figlet_editorFIGlet editor: per-character glyphs, font selection, import/export
burst_effectsCharge-and-release burst effects on BigText glyphs
bash
cargo run --example big_text --features big-text
cargo run --example figlet_editor --features big-text
cargo run --example burst_effects --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

qr-code

ExampleDescription
qr_codeQrCode across render modes, error correction levels, quiet zones, and payload sizes, with a viewport fit check that swaps in a fallback rather than clipping the symbol
bash
cargo run --example qr_code --features qr-code

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
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 and syntax-extra

ExampleDescription
syntax_theme_compareSide-by-side syntax highlighting themes
yaziCompact Yazi-inspired file browser: resizable borderless panes, keyboard/mouse navigation, full-row selection, directory previews, Nerd Font icons, and syntax-highlighted file previews
bash
cargo run --example syntax_theme_compare --features syntax-syntect
cargo run --example yazi --features syntax-extra

yazi requires syntax-extra because its shared file-path detection is used to demonstrate the extended grammar set.

terminal

ExampleDescription
terminal_filetree_devtoolsFileTree + ManagedTerminal devtools split
terminal_search_highlightDisplay-column search highlighting through snapshot decorations
terminal_copy_modeVim-style copy-mode navigation, selection copying, and copy feedback
terminal_hintsURL/path/Git/custom hint mode with end labels, immediate lowercase-copy/uppercase-open activation, and copy flash
bash
cargo run --example terminal_filetree_devtools --features terminal
cargo run --example terminal_search_highlight --features terminal
cargo run --example terminal_copy_mode --features terminal
cargo run --example terminal_hints --features terminal

terminal-images

ExampleDescription
terminal_imagesKitty graphics escapes drawn inside a terminal pane child's output
bash
cargo run --example terminal_images --features terminal-images

theme-reload

ExampleDescription
theme_hot_reloadLive theme reload from a watched TOML file
bash
cargo run --example theme_hot_reload --features theme-reload

devtools

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

MPL-2.0