| Crates.io | tuiuiu |
| lib.rs | tuiuiu |
| version | 0.1.0 |
| created_at | 2025-12-25 04:45:53.344485+00 |
| updated_at | 2025-12-25 04:45:53.344485+00 |
| description | Zero-dependency Terminal UI library with signal-based reactivity and flexbox layout |
| homepage | https://github.com/forattini-dev/tuiuiu.rs |
| repository | https://github.com/forattini-dev/tuiuiu.rs |
| max_upload_size | |
| id | 2004188 |
| size | 313,895 |
Build beautiful, reactive terminal apps with blazing-fast performance.
Zero dependencies โข Signal-based โข Flexbox layout โข Native speed โข Memory safe
50+ components. Pure Rust. No unsafe chaos. Maximum performance.
๐ Documentation ยท ๐ Quick Start ยท ๐ฆ Rust API ยท โก Performance
* Only libc for raw terminal mode
๐ Full Documentation: This is the Rust port of tuiuiu.js. For detailed concepts, architecture, component API, and design philosophy, see the JavaScript documentation โ the APIs are intentionally similar.
# Cargo.toml
[dependencies]
tuiuiu = "0.1"
use tuiuiu::prelude::*;
fn main() {
let app = render(counter);
app.wait_until_exit();
}
fn counter() -> impl Component {
let (count, set_count) = create_signal(0);
use_input(move |key| match key {
Key::Up => set_count.update(|c| *c += 1),
Key::Down => set_count.update(|c| *c -= 1),
Key::Escape => app::exit(),
_ => {}
});
Box::new()
.border(BorderStyle::Round)
.padding(1)
.children([
Text::new("๐ฆ Tuiuiu Counter").color(Color::Cyan).bold(true),
Text::new(move || format!("Count: {}", count.get())),
Text::new("โ/โ: change โข Esc: exit").color(Color::Gray).dim(true),
])
}
cargo run
| Category | Components |
|---|---|
| Core | Signals, Flexbox layout, Focus management, Event system |
| Primitives | Box, Text, Spacer, Newline, Fragment, Divider, Canvas |
| Atoms | Button, TextInput, Switch, Slider, Spinner, ProgressBar |
| Molecules | Select, MultiSelect, RadioGroup, Autocomplete, Table, Tabs, Tree, Calendar, CodeBlock, Markdown |
| Organisms | Modal, CommandPalette, DataTable, FileManager, SplitPanel |
| Templates | AppShell, Page, Header, StatusBar, VStack, HStack |
| Data Viz | BarChart, LineChart, Sparkline, Heatmap, Gauge |
Fine-grained reactivity โ only what changes gets updated.
use tuiuiu::prelude::*;
let (count, set_count) = create_signal(0);
let doubled = create_memo(move || count.get() * 2);
create_effect(move || {
println!("Count: {}, Doubled: {}", count.get(), doubled.get());
});
set_count.set(5); // โ "Count: 5, Doubled: 10"
// Batch multiple updates
batch(|| {
set_count.set(1);
set_count.set(2);
set_count.set(3);
}); // Only one render!
CSS Flexbox model for terminals.
Box::new()
.flex_direction(FlexDirection::Row)
.justify_content(JustifyContent::SpaceBetween)
.align_items(AlignItems::Center)
.gap(2)
.padding(1)
.border(BorderStyle::Round)
.children([
Text::new("Left").color(Color::Blue),
Text::new("Center"),
Text::new("Right").color(Color::Red),
])
use tuiuiu::molecules::*;
// Select dropdown
Select::new()
.items(["Option A", "Option B", "Option C"])
.selected(0)
.build()
// Table with columns
Table::new()
.columns([
Column::new("Name").width(20),
Column::new("Age").width(10).align(Align::Right),
])
.rows([
vec!["Alice".into(), "30".into()],
vec!["Bob".into(), "25".into()],
])
.build()
// Tree view
Tree::new()
.nodes([
TreeNode::folder("src").expanded(true).children([
TreeNode::file("main.rs"),
TreeNode::file("lib.rs"),
]),
])
.build()
// Calendar
Calendar::new()
.date(2025, 1)
.selected(24)
.today(2025, 1, 24)
.build()
// Charts
Sparkline::new().data([1.0, 4.0, 2.0, 8.0, 5.0]).build()
Gauge::new().value(75.0).max(100.0).label("CPU").build()
// Keyboard
use_input(|key| match key {
Key::Char('q') => app::exit(),
Key::Up => { /* ... */ },
Key::Enter => { /* ... */ },
_ => {}
});
// With modifiers
use_hotkeys(|key, mods| {
if mods.ctrl && key == Key::Char('c') {
app::exit();
}
});
// Mouse
use_mouse(|event| match event.kind {
MouseEventKind::Click(MouseButton::Left) => {
println!("Click at ({}, {})", event.x, event.y);
},
_ => {}
});
Pick what you need โ unused code is not compiled.
# Full (default)
tuiuiu = "0.1"
# Minimal core only
tuiuiu = { version = "0.1", default-features = false, features = ["core"] }
# Just what you need
tuiuiu = { version = "0.1", default-features = false, features = ["molecules"] }
| Feature | Contents | Includes |
|---|---|---|
full |
Everything | atoms, molecules, organisms, templates, themes |
core |
Signals, layout, renderer | โ |
primitives |
Box, Text, Spacer, etc. | core |
atoms |
Button, Input, Spinner, etc. | primitives |
molecules |
Select, Table, Tabs, etc. | atoms |
organisms |
Modal, DataTable, etc. | molecules |
templates |
AppShell, Page, etc. | organisms |
themes |
Dark, Light, Monokai, etc. | โ |
Why Rust?
| Metric | tuiuiu.rs | tuiuiu.js |
|---|---|---|
| Startup time | ~1ms | ~50ms |
| Memory usage | ~2MB | ~30MB |
| Binary size | ~500KB | N/A |
| Dependencies | 0* | 0 |
| Type safety | Compile-time | Runtime |
* Only libc for raw terminal mode
# Clone the repo
git clone https://github.com/forattini-dev/tuiuiu.rs
cd tuiuiu.rs
# Run examples
cargo run --example counter # Simple counter
cargo run --example dashboard # Full dashboard
cargo run --example 03_molecules # Component showcase
| Feature | tuiuiu.rs | tuiuiu.js | Ratatui |
|---|---|---|---|
| Signal reactivity | โ | โ | โ |
| Flexbox layout | โ | โ | โ |
| 50+ components | โ | โ | โ |
| Zero deps | โ * | โ | โ |
| Mouse support | โ | โ | โ |
| Native binary | โ | โ | โ |
| Memory safe | โ | โ | โ |
๐ For full documentation, concepts, and detailed API reference, see tuiuiu.js โ the authoritative source.
| Topic | Description |
|---|---|
| Quick Start | Get up and running |
| Signals | Reactive state management |
| Layout | Flexbox for terminals |
| Components | All 50+ components |
| Mouse | Click, hover, scroll |
| Charts | Data visualization |
| Metric | Value |
|---|---|
| Components | 50+ |
| Dependencies | 0* |
| Hooks | 10 |
| Border styles | 9 |
| Named colors | 18 |
| Feature flags | 8 |
| Binary size | ~500KB |
The Tuiuiu (Jabiru mycteria) is a majestic Brazilian bird โ the tallest flying bird in South America. Just like this bird stands out in its environment, Tuiuiu stands out in the terminal UI landscape: elegant, powerful, and distinctly Brazilian.
๐ง๐ท Made with โค๏ธ in Brazil
MIT ยฉ Tetis
tuiuiu.js โ JavaScript/TypeScript version โข tuiuiu.rs โ Rust version (you are here)