Documentation

tui.builders is a visual drag-and-drop editor for designing terminal interfaces. It currently generates production-ready Rust code for SuperLightTUI (SLT), with additional framework support planned.

How to use

  1. Open the editor.
  2. Pick a template or start from a blank project.
  3. Add widgets from the palette.
  4. Customize props, layout, and style in the inspector.
  5. Export generated Rust code.

Prerequisites: Install Rust and ensure cargo is available in your shell.

Editor Guide

Palette

Drag widgets into the tree or click to insert at the current selection.

Canvas

Live visual terminal preview of your current widget tree.

Inspector

Edit widget props, flex layout values, and style tokens in one place.

Code Preview

See generated Rust updates in real time while editing.

Export

Download as a Cargo project zip, export a single .rs file, or copy code to clipboard.

Widget Catalog

All available widgets grouped by category.

Layout (7)

WidgetSLT FunctionDescription
Containerui.container().col(...) / ui.row(...)Flexible parent container with border, spacing, and layout controls.
Spacerui.spacer()Consumes remaining space to align surrounding content.
Separatorui.separator()Draws a horizontal divider line.
Scrollableui.scrollable(&mut state)Adds scroll behavior to tall content regions.
Gridui.grid(cols, ...)Places children into a responsive multi-column layout.
Divider Textui.divider_text(label)Renders a labeled section divider.
Accordionui.accordion(title, &mut open, ...)Expandable section for progressively revealed content.

Text (4)

WidgetSLT FunctionDescription
Textui.text(value)Renders plain terminal text.
Markdownui.markdown(value)Renders markdown with SLT inline formatting.
Linkui.link(label, url)Creates clickable terminal hyperlinks (OSC 8).
Code Blockui.code_block(value)Shows syntax-styled code snippets.

Input (10)

WidgetSLT FunctionDescription
Text Inputui.text_input(&mut state)Single-line text entry field.
Textareaui.textarea(&mut state, rows)Multi-line text editing area.
Buttonui.button(label)Clickable action trigger with variant support.
Sliderui.slider(label, &mut value, min..=max)Adjusts a numeric value over a range.
Confirmui.confirm(question, &mut state)Binary confirmation interaction.
Checkboxui.checkbox(label, &mut checked)Boolean option toggle with checkmark UI.
Toggleui.toggle(label, &mut on)Switch-style boolean control.
Selectui.select(&mut state)Dropdown-style single choice selector.
Radioui.radio(&mut state)Mutually exclusive option set.
Multi-Selectui.multi_select(&mut state)Selects multiple options from a list.

Data (6)

WidgetSLT FunctionDescription
Tableui.table(&mut state)Structured rows and columns with selection support.
Listui.list(&mut state)Vertical selectable list for menu-like flows.
Treeui.tree(&mut state)Hierarchical expandable node viewer.
Virtual Listui.virtual_list(&mut state, visible, ...)Virtualized list for large datasets.
Statui.stat(label, value)Compact metric card with optional trend/color variants.
Def. Listui.definition_list(&[(term, value)])Aligned key/value detail list.

Navigation (5)

WidgetSLT FunctionDescription
Tabsui.tabs(&mut state)Tabbed navigation across content panes.
Cmd Paletteui.command_palette(&mut state)Searchable command launcher overlay.
Help Barui.help(&[(key, desc)])Bottom helper bar for key bindings.
Breadcrumbui.breadcrumb(&[segments])Path-style navigation trail.
Key Hintui.key_hint(key)Inline keyboard hint chip.

Feedback (7)

WidgetSLT FunctionDescription
Progressui.progress(value)Minimal progress meter.
Progress Barui.progress_bar(value, width)Width-controlled progress bar.
Spinnerui.spinner(&state)Animated loading indicator.
Toastui.toast(&mut state)Timed notification stack.
Alertui.alert(message, level)Inline severity callout banner.
Badgeui.badge(label)Compact status or metadata label.
Empty Stateui.empty_state(title, subtitle)Placeholder content for empty screens.

DataViz (7)

WidgetSLT FunctionDescription
Bar Chartui.bar_chart(&[(label, value)], h)Comparative categorical bar visualization.
Sparklineui.sparkline(&values, width)Tiny inline trend graph.
Chartui.chart(builder, w, h)Configurable chart builder for multiple series.
Candlestickui.candlestick(&candles, up, down)OHLC market-style chart rendering.
Heatmapui.heatmap(&grid, w, h, low, high)Color-intensity matrix visualization.
Scatterui.scatter(&points, w, h)Plots point distributions on two axes.
Histogramui.histogram(&values, w, h)Frequency distribution buckets.

Overlay (2)

WidgetSLT FunctionDescription
Modalui.modal(|ui| { ... })Dimmed overlay dialog layer.
Overlayui.overlay(|ui| { ... })Floating content layer without dimming.

AI (3)

WidgetSLT FunctionDescription
Streaming Textui.streaming_text(&mut state)Token-by-token text stream output.
Stream MDui.streaming_markdown(&mut state)Streaming markdown renderer.
Context Barui.context_bar(&items)Context token/source chips for AI workflows.

Form (1)

WidgetSLT FunctionDescription
Form Fieldui.form_field(&mut field)Composable form input field unit.

Media (1)

WidgetSLT FunctionDescription
Imageui.image(&img)Half-block image rendering from RGBA data.

Code Generation

tui.builders transforms your editor tree into Rust through generateRustCode() and emits a ready-to-run main.rs targeting SLT v0.12.x with slt::run_with() and RunConfig.

Example: container + text + button

use slt::*;
use std::time::Duration;

fn main() -> std::io::Result<()> {
    slt::run_with(
        RunConfig {
            theme: Theme::dark(),
            mouse: true,
            tick_rate: Duration::from_millis(16),
            ..Default::default()
        },
        |ui: &mut Context| {
            if ui.key('q') { ui.quit(); }

            ui.bordered(Border::Rounded).pad(1).gap(1).col(|ui| {
                ui.text("Hello from tui.builders").bold().fg(Color::Cyan);
                if ui.button("Click me").clicked {
                    // handle click
                }
                ui.help(&[("q", "quit")]);
            });
        },
    )
}

Running Your Code

All code generated by tui.builders compiles directly against SuperLightTUI. Here's how to run it.

Option 1: Export as Cargo project (.zip)

Click Export → Cargo Project in the editor toolbar. Unzip and run:

unzip my-tui-app.zip
cd my-tui-app
cargo run

Option 2: Export as .rs file

Click Export → .rs File. Create a Cargo project manually:

cargo new my-tui-app
cd my-tui-app
cargo add superlighttui
# Replace src/main.rs with your exported file
cargo run

Option 3: Copy to clipboard

Click Export → Copy. Paste into an existing Cargo project with superlighttui as a dependency.

# In your Cargo.toml:
[dependencies]
superlighttui = "0.12"
Note: Rust and Cargo must be installed. All generated code targets SLT v0.12.x and is verified to compile via automated testing. Press q to quit the running TUI app.

Templates

tui.builders ships with 19 templates spanning dashboards, forms, navigation flows, and operational tooling.

Keyboard Shortcuts

qQuit in generated TUI apps.
TabMove focus to the next widget.
EnterSelect or activate focused controls.
Ctrl+CExit the app immediately.

Supported Frameworks

tui.builders currently generates code for SuperLightTUI. We plan to expand to other TUI ecosystems.

Supported
SuperLightTUI (Rust)

Immediate-mode, zero-unsafe, flexbox layout, 50+ widgets, theming, animation, AI-native widgets

Up Next
Ink (TypeScript)

React-based terminal UI framework by Vadim Demedes

Planned
Ratatui (Rust) · Textual (Python) · Bubbletea (Go)