Skip to content

Examples Index ​

Every example in the repository's example/ directory, running live in WebAssembly and accompanied by its C++ source code.

Applications ​

Complete applications, showing how individual features compose into full programs.

ExampleDemonstratesGuide
showcase.cppA gallery of interface patterns a terminal application needs.Guide
app_dashboard.cppA complete application, rather than a demo of one property.Guide
app_filebrowser.cppA complete application driven by the keyboard.Guide
inline_install.cppAn inline application: a package installer drawn below the command that started it, as apt install is, rather than over the whole terminal.Guide
inline_prompt.cppAn inline prompt that stays: pick dependencies to add, one after the other, below the command that started it, as cargo add or npm install would.Guide
playground.cppA live HTML/CSS editor and preview, side by side.Guide

Core Concepts ​

Components, reactivity, interpolation, conditional rendering, and slots.

ExampleDemonstratesGuide
conditional.cppConditional rendering.Guide
counter.cppReactive state and {...} interpolation.Guide
helloworld.cppThe smallest possible RTXUI application.Guide
loop_complex.cppLooping over a collection of structs.Guide
loop_simple.cppLooping over a std::vector<std::string> with <for>.Guide
slots.cppContent projection with <slot>.Guide

Form Elements ​

User input through keyboard and mouse, bound to C++ variables.

ExampleDemonstratesGuide
checkbox.cppThe <checkbox> component bound to a bool.Guide
fieldset.cpp<fieldset> and <legend> grouping.Reference
input.cppThe <input> component with two-way binding.Guide
label.cpp<label> delegating clicks and focus to the control it names.Guide
progress.cppThe <progress> component driven by bound state.Guide
radio.cpp<radio> buttons sharing a name, with the selection bound to a C++ string.Guide
select.cppThe <select> dropdown with <option> children.Guide
slider.cppThe <slider> component bound to an int.Guide
textarea.cppThe <textarea> component: multi-line editing with a line-number gutter.Guide

Layout & Box Model ​

Positioning terminal cells with flexbox, grid, borders, and margins.

ExampleDemonstratesGuide
border_scroll_demo.cppBorders and scrollbars sharing an edge.Guide
borders.cppEvery border style: solid, double, dashed, round, tall, vkey and more.Guide
grid.cppCSS grid.Guide
layout.cppFlexbox basics.Guide
layout_flex.cppAn interactive flexbox playground.Guide
positioning.cppposition: relative, absolute and fixed, plus z-index stacking.Guide
sticky.cppposition: sticky.Guide

Scrolling & Overflow ​

Handling scrollable regions, focus tracking, and overflow behavior.

ExampleDemonstratesGuide
anchor.cppAnchor navigation.Guide
focus_scroll.cppScroll-into-view on keyboard focus.Guide
horizontal_scroll.cppHorizontal overflow.Guide
nested_scroll.cppNested scroll containers and scroll chaining.Guide
scroll_behavior.cppscroll-behavior: smooth versus auto.Guide
virtual_list.cppA virtual list: 100,000 log lines.Guide

Typography & Styling ​

Colors, text decorations, pseudo-classes, transitions, and keyframe animations.

ExampleDemonstratesGuide
animation.cppAnimating layout.Guide
colors.cppForeground and background colors.Guide
focus_states.cppFocus styling: :focus-within, :focus-visible and currentColor.Guide
keyframes.cppCSS keyframe animations.Guide
opacity.cppOpacity and alpha blending, including how nested opacity compounds.Guide
pseudo_classes.cppThe interactive pseudo-classes: :hover, :focus and :active.Guide
selector_lists.cppSelector lists: :is() and :where().Guide
text_align.cpptext-align: left, center and right.Guide
text_decoration.cppText decoration: bold, dim, italic, underline and strikethrough.Guide
transitions.cppCSS transitions.Guide
translate.cppMoving boxes with translate.Guide
translucent.cppTranslucent colors over the terminal's own background.Reference

Components & Advanced Features ​

Built-in HTML elements, CJK text, Markdown rendering, spatial nav, and cookbook recipes.

ExampleDemonstratesGuide
cjk.cppDouble-width text.Guide
cookbook_async.cppRecipe: updating the UI from a worker thread.Guide
cookbook_command_palette.cppRecipe: a command palette.Guide
cookbook_dialog.cppRecipe: a confirmation dialog.Guide
cookbook_tabs.cppRecipe: tabs built by hand.Guide
details.cppThe <details>/<summary> disclosure widget.Reference
dialog.cppThe built-in <dialog> element.Reference
events.cppInspecting the input events: every key and mouse action the terminal sends.Guide
hr.cppThe <hr> separator, and how border styles apply to it.Reference
hyperlinks.cppTerminal hyperlinks: an <a href> to a URL becomes a clickable link.Reference
lists.cpp<ul>, <ol> and <li>, including nesting, start/reversed, per-item value, and the list-style-type property.Reference
markdown.cppThe <markdown> component: a live editor and rendered preview, side by side.Guide
media.cpp@media queries reacting to terminal size.Guide
spatial_navigation.cppArrow-key spatial navigation.Guide
tabindex.cppControlling focus order with tabindex.Guide
table.cppTable elements: <table>, <thead>, <tr>, <th>, <td>, with colspan, rowspan and a sticky header row.Reference
tabs.cppThe built-in <tabs>/<tab-pane> components.Reference
toast.cppToast notifications.Reference
tooltip.cppThe <tooltip> component, shown on hover in each of four directions.Reference
tree.cppA tree view.Reference