ratatui

Solid

Use this skill for any task involving a Rust terminal/text user interface (TUI) built with Ratatui (or crossterm), whether creating one or debugging, fixing, testing, or extending an existing one. Covers: scaffolding the initial `main`/render loop and terminal setup; fixing teardown so a panic or crash doesn't leave the terminal in raw mode / broken; laying out panels, sidebars, status bars, dashboards, and popups with Layout/Constraint; wiring widgets like List, Table, Gauge, Chart, Scrollbar (including selection/scroll state that won't move); styling, text wrapping, and Unicode width issues; streaming LLM/async output into a terminal; and unit-testing rendered output without a real terminal. Triggers on "rust + terminal app/UI/dashboard", ratatui, crossterm. Writes current Ratatui 0.30+ code, not stale tui-rs patterns. Not for: Go TUIs (Bubble Tea), Python TUIs (Textual), non-interactive CLI output or progress bars, web/browser UIs, image-to-ASCII art (ascii/textmode), or tmux/agent-session orchestration.

Web & Frontend 1 stars 0 forks Updated 2 days ago Apache-2.0

Install

View on GitHub

Quality Score: 80/100

Stars 20%
10
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# Ratatui Write current, compiling Ratatui code (pinned to **0.30.x**, Rust 2024) and refuse the stale tui-rs patterns the model remembers from training. The body is the load-bearing 20%: one mental model and one verified example per concept. Everything enumerable — the full widget catalog, every constraint, the streaming model, testing, migration — lives in `references/`. Open the matching reference before writing nontrivial code in that area. ## Mental model Ratatui is **immediate mode**: there are no retained widget objects. Every frame you build the whole UI from your own application state and throw it away. A render loop runs `terminal.draw(|frame| …)`; inside, you slice the area into rectangles and draw widgets into them. Ratatui keeps two `Buffer`s and **diffs** them, writing only the changed cells to the terminal — so redrawing the entire screen every frame is cheap and correct. You own the loop: read an event, update state, draw, repeat. Four nouns carry everything: - **Terminal** — owns the backend (crossterm by default) and the double buffers; gives you a `Frame`. - **Frame** — one frame's drawing surface; `frame.area()` is the full `Rect`, `frame.render_widget(w, rect)` draws. - **Buffer** — the grid of styled cells widgets write into. Dimensions are `u16` (max 65,535 per side). - **Rect** — an `x/y/width/height` region in `u16`. Layout is just splitting one `Rect` into more `Rect`s. ## Lifecycle: never hand-roll the terminal Ratatui sets up raw mode, the a...

Details

Author
vinsonconsulting
Repository
vinsonconsulting/claude-skill-foundry
Created
1 months ago
Last Updated
2 days ago
Language
Python
License
Apache-2.0

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category