# alloy_tui Alloy's design system for [ratatui](https://ratatui.rs): themed widgets, a reserved keymap, and a focus ring, driven by [makeover](https://crates.io/crates/makeover) themes. Extracted from the Alloy console so other terminal UIs can share one look rather than each re-deriving colors from a palette. ## What it gives you - **`Theme`** — a makeover `.toml` theme resolved into ratatui `Color`/`Style`. Two Alloy-specific tokens (`border-subtle`, `border-strong`) are derived locally so theme files stay minimal and cross-app compatible. - **Widgets** — `AlloyBlock`, `AlloyList`, `AlloyTabs`, `AlloyStatusBar`, `AlloyModal`, `AlloyLog`, each taking a `&Theme`. - **Forms** — `AlloyForm` over `AlloyField` rows, `AlloyPicker` for the filterable overlay a closed vocabulary opens, plus a display-only `AlloyTable`. One field widget carrying a `FieldKind` value cell rather than one widget per value type: the widgets own no value and do no validation, so they differ only in how the cell paints. `TextField` is the caret buffer a field shows in edit mode. - **`keys`** — the reserved keymap every Alloy TUI agrees on, so the same keys mean the same thing across tools. - **`focus`** — a focus ring, the piece ratatui deliberately leaves to the app. ## Color is information Chrome is tinted greyscale. Accent color lives on text, carried by `Severity`, so a colored thing on screen means something rather than decorating. Widgets enforce this; you get it by using them. ## Usage ```rust use alloy_tui::{AlloyStatusBar, Theme, hint}; // Resolve a makeover theme into ratatui colors. let dirs = vec![(makeover::bundled_themes_dir().unwrap(), false)]; let colors = makeover::load_theme(&dirs, "akari-night").unwrap(); let theme = Theme::from_theme(&colors).unwrap(); // Widgets take &Theme. let footer = AlloyStatusBar::new(&theme, [hint("Tab", "focus"), hint("q", "quit")]); ``` There is deliberately no built-in fallback palette. A missing or malformed theme is an error you surface, not something papered over by rendering in colors that exist nowhere in the theme files. ## License MIT. Split out of the [Alloy](https://git.sr.ht/~maxmj/alloy) repository, which is GPLv3-or-later. This crate is permissive on purpose: it is the reusable design system, not the application, and other terminal UIs should be able to adopt the look without inheriting copyleft.