ratatui/ratatui
A Rust crate for cooking up terminal user interfaces (TUIs) π¨βπ³π https://ratatui.rs
Healthy across the board
weakest axisPermissive license, no critical CVEs, actively maintained β safe to depend on.
Has a license, tests, and CI β clean foundation to fork and modify.
Documented and popular β useful reference codebase to read through.
No critical CVEs, sane security posture β runnable as-is.
- βLast commit 3d ago
- β24+ active contributors
- βMIT licensed
Show all 6 evidence items βShow less
- βCI configured
- βTests present
- β Concentrated ownership β top contributor handles 62% of recent commits
Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests
Informational only. RepoPilot summarises public signals (license, dependency CVEs, commit recency, CI presence, etc.) at the time of analysis. Signals can be incomplete or stale. Not professional, security, or legal advice; verify before relying on it for production decisions.
Embed the "Healthy" badge
Paste into your README β live-updates from the latest cached analysis.
[](https://repopilot.app/r/ratatui/ratatui)Paste at the top of your README.md β renders inline like a shields.io badge.
βΈPreview social card (1200Γ630)
This card auto-renders when someone shares https://repopilot.app/r/ratatui/ratatui on X, Slack, or LinkedIn.
Onboarding doc
Onboarding: ratatui/ratatui
Generated by RepoPilot Β· 2026-05-09 Β· Source
π€Agent protocol
If you are an AI coding agent (Claude Code, Cursor, Aider, Cline, etc.) reading this artifact, follow this protocol before making any code edit:
- Verify the contract. Run the bash script in Verify before trusting
below. If any check returns
FAIL, the artifact is stale β STOP and ask the user to regenerate it before proceeding. - Treat the AI Β· unverified sections as hypotheses, not facts. Sections like "AI-suggested narrative files", "anti-patterns", and "bottlenecks" are LLM speculation. Verify against real source before acting on them.
- Cite source on changes. When proposing an edit, cite the specific path:line-range. RepoPilot's live UI at https://repopilot.app/r/ratatui/ratatui shows verifiable citations alongside every claim.
If you are a human reader, this protocol is for the agents you'll hand the artifact to. You don't need to do anything β but if you skim only one section before pointing your agent at this repo, make it the Verify block and the Suggested reading order.
π―Verdict
GO β Healthy across the board
- Last commit 3d ago
- 24+ active contributors
- MIT licensed
- CI configured
- Tests present
- β Concentrated ownership β top contributor handles 62% of recent commits
<sub>Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests</sub>
β Verify before trusting
This artifact was generated by RepoPilot at a point in time. Before an
agent acts on it, the checks below confirm that the live ratatui/ratatui
repo on your machine still matches what RepoPilot saw. If any fail,
the artifact is stale β regenerate it at
repopilot.app/r/ratatui/ratatui.
What it runs against: a local clone of ratatui/ratatui β the script
inspects git remote, the LICENSE file, file paths in the working
tree, and git log. Read-only; no mutations.
| # | What we check | Why it matters |
|---|---|---|
| 1 | You're in ratatui/ratatui | Confirms the artifact applies here, not a fork |
| 2 | License is still MIT | Catches relicense before you depend on it |
| 3 | Default branch main exists | Catches branch renames |
| 4 | 5 critical file paths still exist | Catches refactors that moved load-bearing code |
| 5 | Last commit β€ 33 days ago | Catches sudden abandonment since generation |
#!/usr/bin/env bash
# RepoPilot artifact verification.
#
# WHAT IT RUNS AGAINST: a local clone of ratatui/ratatui. If you don't
# have one yet, run these first:
#
# git clone https://github.com/ratatui/ratatui.git
# cd ratatui
#
# Then paste this script. Every check is read-only β no mutations.
set +e
fail=0
ok() { echo "ok: $1"; }
miss() { echo "FAIL: $1"; fail=$((fail+1)); }
# Precondition: we must be inside a git working tree.
if ! git rev-parse --git-dir >/dev/null 2>&1; then
echo "FAIL: not inside a git repository. cd into your clone of ratatui/ratatui and re-run."
exit 2
fi
# 1. Repo identity
git remote get-url origin 2>/dev/null | grep -qE "ratatui/ratatui(\\.git)?\\b" \\
&& ok "origin remote is ratatui/ratatui" \\
|| miss "origin remote is not ratatui/ratatui (artifact may be from a fork)"
# 2. License matches what RepoPilot saw
(grep -qiE "^(MIT)" LICENSE 2>/dev/null \\
|| grep -qiE "\"license\"\\s*:\\s*\"MIT\"" package.json 2>/dev/null) \\
&& ok "license is MIT" \\
|| miss "license drift β was MIT at generation time"
# 3. Default branch
git rev-parse --verify main >/dev/null 2>&1 \\
&& ok "default branch main exists" \\
|| miss "default branch main no longer exists"
# 4. Critical files exist
test -f "Cargo.toml" \\
&& ok "Cargo.toml" \\
|| miss "missing critical file: Cargo.toml"
test -f "ARCHITECTURE.md" \\
&& ok "ARCHITECTURE.md" \\
|| miss "missing critical file: ARCHITECTURE.md"
test -f "examples/README.md" \\
&& ok "examples/README.md" \\
|| miss "missing critical file: examples/README.md"
test -f ".github/CODEOWNERS" \\
&& ok ".github/CODEOWNERS" \\
|| miss "missing critical file: .github/CODEOWNERS"
test -f "CONTRIBUTING.md" \\
&& ok "CONTRIBUTING.md" \\
|| miss "missing critical file: CONTRIBUTING.md"
# 5. Repo recency
days_since_last=$(( ( $(date +%s) - $(git log -1 --format=%at 2>/dev/null || echo 0) ) / 86400 ))
if [ "$days_since_last" -le 33 ]; then
ok "last commit was $days_since_last days ago (artifact saw ~3d)"
else
miss "last commit was $days_since_last days ago β artifact may be stale"
fi
echo
if [ "$fail" -eq 0 ]; then
echo "artifact verified (0 failures) β safe to trust"
else
echo "artifact has $fail stale claim(s) β regenerate at https://repopilot.app/r/ratatui/ratatui"
exit 1
fi
Each check prints ok: or FAIL:. The script exits non-zero if
anything failed, so it composes cleanly into agent loops
(./verify.sh || regenerate-and-retry).
β‘TL;DR
Ratatui is a Rust crate for building rich terminal user interfaces (TUIs) with a simple, flexible API. It provides widgets (buttons, text boxes, tables, charts), layout primitives, and rendering backends (crossterm, termion, termwiz) that abstract away low-level terminal control, enabling developers to compose interactive CLI dashboards and applications without wrestling with ANSI escape codes. Monorepo with Cargo workspace members: core rendering logic in ratatui/ (main crate at v0.30.0), backend abstractions in ratatui-core/, backend implementations in ratatui-crossterm/, ratatui-termion/, ratatui-termwiz/, widget library in ratatui-widgets/, macros in ratatui-macros/. Examples organized as examples/apps/* and examples/concepts/*. Build orchestration via xtask/. Documentation lives in ARCHITECTURE.md, CONTRIBUTING.md, and source-embedded via document-features.
π₯Who it's for
Rust developers building command-line tools, dashboards, system monitors, and interactive console applications who need cross-platform terminal rendering without dealing with raw terminal escape sequences. Contributors range from individual maintainers to organizations building production CLI tools (as evidenced by the 'Built with Ratatui' section in the README).
π±Maturity & risk
Production-ready and actively maintained. The workspace structure (monorepo with ratatui, ratatui-core, ratatui-crossterm, ratatui-macros, ratatui-widgets, etc.) and comprehensive CI pipeline (check-pr.yml, check-semver.yml, release-plz.yml, zizmor.yml) indicate professional project management. Version 0.30.0 with MSRV 1.88.0 and established release process via git-cliff shows stability; the EuroRust 2024 talk signals ongoing community investment.
Low risk for a foundational library. The monorepo structure with modular crates reduces coupling, and semver checking (check-semver.yml) guards API stability. Main risks: the project depends on multiple backend crates (crossterm, termion, termwiz) which external projects maintain, and while actively developed, breaking changes are tracked (BREAKING-CHANGES.md exists). Single-maintainer burnout could be a concernβmonitor MAINTAINERS.md and contributor activity.
Active areas of work
Active development on widget ecosystem expansion (ratatui-widgets crate), backend abstraction refinement (ratatui-core), and maintainer onboarding (MAINTAINERS.md exists). Release workflow automated via release-plz.yml. Dependency management via Dependabot. Security scanning via zizmor.yml. Conventional Commits enforced for changelog generation (cliff.toml, .cz.toml).
πGet running
git clone https://github.com/ratatui/ratatui.git
cd ratatui
cargo build
cargo test
cargo run --example widgets # run widget showcase
Or scaffold a new project: cargo install cargo-generate && cargo generate ratatui/templates.
Daily commands:
Development: cargo build && cargo test. Run examples: cargo run --example <name> (see examples/README.md for list). Run benchmarks: cargo bench. Check semver: CI runs check-semver.yml automatically on PR. Release process: automated via release-plz.yml on merge to main.
πΊοΈMap of the codebase
Cargo.tomlβ Workspace root configuration defining all members (ratatui, ratatui-crossterm, ratatui-widgets, etc.) and shared dependencies for the entire TUI framework ecosystem.ARCHITECTURE.mdβ High-level design documentation explaining the crate's structure, layer separation, and architectural decisions that guide all contributions.examples/README.mdβ Overview of example apps and concepts demonstrating core patterns and best practices for using and extending the framework..github/CODEOWNERSβ Defines code ownership and review requirements per module, critical for understanding review workflows and responsibility boundaries.CONTRIBUTING.mdβ Contribution guidelines covering coding standards, testing expectations, and submission process for the Ratatui project..github/pull_request_template.mdβ PR template enforcing description of changes, testing, and documentation updates required for all code submissions.clippy.tomlβ Linting configuration defining code quality standards and style rules enforced across the codebase.
π οΈHow to make changes
Add a new Widget
- Create widget struct in ratatui-widgets with State and Props (
ratatui-widgets/src/widgets/[widget_name].rs) - Implement Widget trait with render logic in draw method (
ratatui-widgets/src/widgets/[widget_name].rs) - Export widget from module in ratatui-widgets/src/lib.rs (
ratatui-widgets/src/lib.rs) - Add example demonstrating widget usage under examples/apps/ (
examples/apps/[widget_example]/src/main.rs) - Document public API with rustdoc comments and usage examples (
ratatui-widgets/src/widgets/[widget_name].rs)
Add a new Backend Implementation
- Create new ratatui-[backend] crate directory with Cargo.toml (
ratatui-[backend]/Cargo.toml) - Implement Backend trait from ratatui-core with required methods (
ratatui-[backend]/src/lib.rs) - Add terminal initialization and event handling logic (
ratatui-[backend]/src/backend.rs) - Add ratatui-[backend] as optional feature in root Cargo.toml (
Cargo.toml) - Create example in examples/apps/ demonstrating backend initialization (
examples/apps/demo/src/[backend].rs)
Fix a Bug or Add a Feature
- Write failing test or example in appropriate test/ or examples/ location (
examples/apps/demo/src/main.rs or ratatui/tests/) - Implement fix in the relevant module (widgets, core, or backend) (
ratatui-widgets/src/widgets/[component].rs or ratatui-core/src/) - Verify test passes and update BREAKING-CHANGES.md if API changed (
BREAKING-CHANGES.md) - Document changes in code comments and rustdoc (
[modified_file].rs) - Ensure CI passes: cargo test, cargo clippy, cargo fmt (
.github/workflows/ci.yml)
π§Why these technologies
- Rust β Memory-safe systems language with zero-cost abstractions enabling both safe terminal control and minimal overhead for real-time rendering.
- Trait-based backend abstraction (Backend trait) β Allows swappable terminal backends (crossterm, termion, termwiz) without core framework changes, maintaining decoupling and testability.
- Immediate-mode rendering (Frame/draw closure) β Simplifies state management by recomputing entire UI each frame; differs from retained-mode, enabling simpler user code at cost of CPU.
- Workspace with multiple crates (ratatui-*, ratatui-core, ratatui-widgets) β Separates concerns (core abstractions, widgets, backends) allowing granular dependency selection and independent versioning.
- Semantic versioning with automated release-plz β Ensures stable API contracts and clear breaking change communication; automated workflow reduces human error in version bumping.
βοΈTrade-offs already made
-
Immediate-mode rendering over retained-mode (DOM-like) tree
- Why: Simpler mental model and less boilerplate for app developers; no widget state trees to manage.
- Consequence: Full UI recompute every frame (higher CPU) vs. incremental updates; unsuitable for extremely large UIs or resource-constrained environments.
-
Synchronous single-threaded rendering loop
- Why: Simplicity and predictability; avoids race conditions in UI state.
- Consequence: Long-running widget renders block event handling; async work must happen outside the render closure.
-
Backend trait abstraction vs. single backend
- Why: Cross-platform support (Windows, macOS, Linux); users pick their backend at compile time.
- Consequence: Slightly more API surface and testing burden; build complexity with feature flags.
-
Text-based terminal only (no GPU acceleration)
- Why: Broad compatibility (works over SSH, in containers, minimal deps) and simplicity.
- Consequence: Limited to ANSI color palette and text-based rendering; no smooth animations or pixel-perfect graphics.
π«Non-goals (don't propose these)
- Does not provide built-in async event handling; users must integrate external event loops (crossterm channels, tokio, async-std).
- Does not handle application state management; framework is UI-only, state patterns left to user.
- Does not provide input validation or form-building macros; widgets focus on display, input logic is user responsibility.
- Does not support GPU or graphical backends; restricted to terminal/text-mode environments.
- Does not include a layout engine like CSS/flexbox; constraint-based layout (Rect) is fixed and manual.
- Does not provide data binding or reactive programming primitives; immediate-mode requires explicit update calls.
πͺ€Traps & gotchas
Workspace default-members: ratatui-termion intentionally excluded from default-members because it doesn't compile on Windows (see comment in Cargo.toml)βif testing all members, use cargo test --workspace not just cargo test. Edition 2024: workspace uses Rust edition 2024, ensure MSRV 1.88.0+ is installed. Backend selection: ratatui-core defines interface but users must bring a concrete backend (crossterm is most common); forgetting to add a backend dependency will fail at runtime. Feature flags: many widgets behind feature gates (document-features 0.2 enforces this)βcheck Cargo.toml features before using a widget. Dependabot: auto-updates from dependabot.yml may introduce breaking changes in workspace deps (palette 0.7.6, crossterm 0.29, etc.)βalways run full test suite after dependency updates.
ποΈArchitecture
πRelated repos
crossterm-rs/crosstermβ Low-level backend that Ratatui wraps; understanding crossterm's event handling and terminal manipulation is essential for backend-level debugging.fdehau/tui-rsβ Historical predecessor to Ratatui (Ratatui is the maintained fork after tui-rs maintenance issues); useful for understanding design evolution and learning from earlier API decisions.ratatui/templatesβ Official project scaffolding via cargo-generate; users clone this to bootstrap new Ratatui appsβecosystem entry point.zellij-org/zellijβ Terminal multiplexer and example Ratatui use case; reference for production TUI architecture and state management in complex apps.BurntSushi/termcolorβ Alternative color/style library; compare with how Ratatui (via palette 0.7.6) handles color abstraction and portability.
πͺPR ideas
To work on one of these in Claude Code or Cursor, paste:
Implement the "<title>" PR idea from CLAUDE.md, working through the checklist as the task list.
Add comprehensive widget integration tests in ratatui-widgets
The repo has split widgets into a separate crate (ratatui-widgets) but there's no dedicated integration test suite visible in the file structure. The examples/apps directory shows complex widget usage patterns that should be formalized as regression tests. This would prevent widget breaking changes and help new contributors understand widget composition.
- [ ] Create tests/integration/ directory in ratatui-widgets crate
- [ ] Add tests for widget rendering output consistency across ratatui, ratatui-crossterm, and ratatui-termwiz backends
- [ ] Add tests for widget state mutations and event handling
- [ ] Reference the canvas, chart, and calendar-explorer examples as test scenarios
Expand ARCHITECTURE.md with backend abstraction layer documentation
The workspace contains multiple backend crates (ratatui-core, ratatui-crossterm, ratatui-termion, ratatui-termwiz) but ARCHITECTURE.md doesn't explain the backend trait design, how to implement a new backend, or the stability guarantees for the backend API. This is a critical knowledge gap for contributors wanting to add new terminal backends.
- [ ] Document the backend trait interface in ARCHITECTURE.md with code examples
- [ ] Add a 'Implementing a Custom Backend' section with step-by-step guide
- [ ] Reference ratatui-core/src/lib.rs as the source of truth for the backend API
- [ ] Link to each backend implementation (ratatui-crossterm, ratatui-termwiz, ratatui-termion) as reference implementations
Add GitHub Action workflow for testing cross-backend compatibility
The repo has multiple backends (crossterm, termion, termwiz) but no dedicated CI workflow that ensures changes work consistently across all backends. Currently, .github/workflows/ shows check-pr.yml and ci.yml but likely doesn't test all feature combinations. This would catch subtle backend-specific bugs early.
- [ ] Create .github/workflows/test-backends.yml that runs tests with each backend feature flag
- [ ] Include matrix testing for ratatui-core, ratatui-crossterm, ratatui-termion, and ratatui-termwiz
- [ ] Add a job to verify examples compile against each backend variant
- [ ] Ensure it runs on PR events and is referenced in CONTRIBUTING.md
πΏGood first issues
- Add missing widget examples to examples/concepts/: The examples/README.md references widget showcase but
examples/concepts/may lack isolated examples for new widgets in ratatui-widgets/. Pick an undemonstrated widget (check the directory), createexamples/concepts/<widget_name>/with a minimal runnable demo and README explaining the featureβlow risk, high visibility. - Improve documentation coverage for backend trait in ratatui-core/src/lib.rs: The backend abstraction should have detailed rustdoc examples showing how to implement a new backend (e.g., for a hypothetical termwizard or custom backend). Add
/// # Examplessections with code snippetsβhelps future contributors and demonstrates the design. - Add snapshot tests for widget rendering output: The repo has unit tests but likely lacks golden-file / snapshot tests verifying exact rendered terminal output for widgets. Pick one widget (e.g., Table or Chart), create
tests/snapshot_<widget_name>.rsthat renders to a buffer and compares formatted outputβcatches regressions early and documents expected behavior.
βTop contributors
Click to expand
Top contributors
- @dependabot[bot] β 62 commits
- @orhun β 7 commits
- @joshka β 4 commits
- @junkdog β 4 commits
- @sermuns β 2 commits
πRecent commits
Click to expand
Recent commits
18aa467β fix(examples): make line-gauge example compatible with macos sequoia's terminal.app (#2474) (lazo4)a5b08d6β feat(widgets): add Fill widget (#2520) (Metbcy)a443724β build(deps): bump taiki-e/install-action from 2.75.23 to 2.76.0 (#2522) (dependabot[bot])ea43ca4β build(deps): bump crate-ci/typos from 1.45.2 to 1.46.0 (#2524) (dependabot[bot])5d952ccβ build(deps): bump crate-ci/typos from 1.45.1 to 1.45.2 (#2513) (dependabot[bot])1d82d90β build(deps): bump octocrab from 0.49.7 to 0.49.9 (#2514) (dependabot[bot])33110e6β build(deps): bump taiki-e/install-action from 2.75.18 to 2.75.23 (#2515) (dependabot[bot])2333bc3β build(deps): bump lru from 0.17.0 to 0.18.0 (#2516) (dependabot[bot])957fbb0β fix(core): use correct width for halfwidth dakuten/handakuten (#2499) (orhun)32e2111β build(deps): bump zizmorcore/zizmor-action from 0.5.2 to 0.5.3 (#2503) (dependabot[bot])
πSecurity observations
The Ratatui codebase demonstrates generally good security practices as a Rust TUI library with no obvious injection vulnerabilities, hardcoded secrets, or critical misconfigurations visible in the provided files. However, there are areas for improvement: the SECURITY.md policy needs enhancement with more detail and typo fixes, the Cargo.toml edition setting is invalid and should be corrected, and automated dependency scanning should be integrated into CI/CD. The truncated dependency file prevents complete verification. No critical vulnerabilities were identified in the visible codebase structure, but ongoing dependency auditing and security policy documentation improvements are recommended.
- Low Β· Incomplete SECURITY.md Policy β
SECURITY.md. The SECURITY.md file contains a typo ('secuirity' instead of 'security') and lacks detailed information about security practices. The policy only mentions supporting the latest version without specifying patch release cadence or security update timelines. Fix: Fix the typo and expand the security policy to include: security update timelines, supported version ranges, security contact information beyond the GitHub form, and disclosure guidelines. - Low Β· Cargo.toml Edition Set to 2024 β
Cargo.toml (workspace.package.edition). The workspace Cargo.toml specifies edition = '2024', which is not a stable Rust edition. Valid editions are 2015, 2018, and 2021. This may cause compilation issues or unexpected behavior. Fix: Change edition to a valid stable edition, preferably '2021' or '2018', depending on minimum supported Rust version requirements. - Low Β· Truncated Dependencies File β
Cargo.toml (workspace.dependencies). The provided Cargo.toml workspace dependencies section appears truncated at 'ratatui-widgets = { path = "ratat', making it impossible to verify all dependency specifications completely. This could mask potential vulnerabilities. Fix: Verify the complete Cargo.toml file is available and all dependencies are properly specified. Run 'cargo tree' to audit the full dependency tree and check for known vulnerabilities using 'cargo audit'. - Medium Β· No Visible SBOM or Dependency Verification β
.github/workflows/. The project uses a workspace with multiple members and dependencies, but there's no evidence of SBOM (Software Bill of Materials) generation or automated dependency verification in the visible CI configuration. Fix: Implement automated dependency scanning using tools like 'cargo-audit', 'cargo-deny', or generate SBOMs using 'cargo-sbom' in CI/CD pipelines. - Low Β· Broad Workflow Permissions β
.github/workflows/. GitHub workflows in .github/workflows/ may have excessive permissions. Without viewing the specific workflow files, best practices suggest ensuring minimal permissions are granted. Fix: Review all workflow files to ensure they follow the principle of least privilege. Explicitly set 'permissions' at workflow and job levels. Use GitHub's token scoping features to limit access.
LLM-derived; treat as a starting point, not a security audit.
πWhere to read next
- Open issues β current backlog
- Recent PRs β what's actively shipping
- Source on GitHub
Generated by RepoPilot. Verdict based on maintenance signals β see the live page for receipts. Re-run on a new commit to refresh.