Blaeck
A component-based terminal UI framework for Rust — flexbox layout, async-first, inline rendering.
Preview

Quickstart
[]
= "0.1"
use *;
use Blaeck;
use io;
Output:
╭────────────────────────────╮
│ Status: Ready │
│ Progress: [████████░░] 80% │
╰────────────────────────────╯
Interactive Example
use *;
use ;
Why Blaeck
Blaeck is...
- Component-based — Build UIs from composable, reusable components
- Flexbox layout — Powered by Taffy, the same engine used by Dioxus
- Inline rendering — Renders within terminal flow, coexists with stdout
- Async-first — Native tokio integration for background tasks
- JSX-like syntax —
element!macro for declarative UI trees - Focus management — Tab navigation with hooks for accessibility
- 35+ components — Tables, trees, modals, syntax highlighting, charts, and more
Blaeck is NOT...
- A fullscreen TUI framework (use Ratatui for that)
- A prompt-only library (use inquire or dialoguer for simple prompts)
- An immediate-mode renderer
When to use Blaeck
- CLI tools with rich output (installers, build tools, dev servers)
- Interactive prompts that need layout control
- Dashboards that update in-place
- Progress displays with multiple concurrent tasks
- Any terminal UI that shouldn't take over the whole screen
Feature Highlights
Layout System
element!
Interactive Forms
// Text input with state
let mut input_state = new;
element!
Data Display
// Table with selection
element!
// Tree view
element!
Components
| Category | Components | Notes |
|---|---|---|
| Layout | Box, Spacer, Newline, Indent, Transform |
Flexbox-based |
| Text | Text, Gradient, Markdown, SyntaxHighlight |
Full styling |
| Input | TextInput, Checkbox, Select, MultiSelect, Confirm, Autocomplete |
Interactive, focus-aware |
| Data | Table, Tabs, TreeView, BarChart, Sparkline |
Scrollable, selectable |
| Feedback | Spinner, Progress, Timer, LogBox, Diff |
Animated |
| Navigation | Breadcrumbs, StatusBar, KeyHints |
Context display |
| Overlay | Modal, Badge, Link, Divider |
Dialogs, alerts |
| Animation | AnimationTimer, blink, Easing |
10+ easing functions |
Architecture
Rendering Model
Blaeck uses inline rendering: it tracks how many lines were written and overwrites them on re-render. This means:
- Output stays in terminal scrollback
println!()works afterunmount()- Multiple Blaeck instances can coexist
- No alternate screen buffer
Render throttling prevents excessive CPU usage:
blaeck.set_max_fps; // Limit to 30 renders/second
Layout System
Uses Taffy for flexbox layout:
flex_direction: Row or Columnjustify_content,align_items: Standard flexbox alignmentgap,padding,margin: Spacingflex_grow,flex_shrink: Flexible sizing
Focus Management
let mut focus = new;
focus.register;
focus.register;
focus.on_focus_change;
// In input handler
match_key
.on_tab
.on_backtab;
Async Model
Enable with features = ["async"]:
use ;
async
Examples
# Basic
# Components
# Advanced
Comparison
| Blaeck | Ratatui | inquire | dialoguer | |
|---|---|---|---|---|
| Rendering | Inline | Fullscreen | Inline | Inline |
| Layout | Flexbox | Constraint-based | None | None |
| Component model | Yes | No (immediate) | No | No |
| Async support | Native | Manual | No | No |
| Focus management | Built-in | Manual | Per-prompt | Per-prompt |
| Use case | Rich CLIs | Full TUIs | Prompts | Prompts |
Roadmap
- Mouse support
- Virtualized scrolling for large datasets
- Theming system
- More chart types (line, pie)
- Terminal capability detection
- Accessibility improvements
Contributing
# Build
# Test (660 tests)
# Lint
# Format
PRs and issues welcome. For larger changes, open an issue first to discuss.
License
MIT OR Apache-2.0