| Crates.io | fusabi-tui-core |
| lib.rs | fusabi-tui-core |
| version | 0.2.0 |
| created_at | 2025-12-15 03:21:27.555732+00 |
| updated_at | 2025-12-29 16:52:20.563493+00 |
| description | Core TUI primitives for Fusabi |
| homepage | |
| repository | https://github.com/fusabi-lang/fusabi-tui-runtime |
| max_upload_size | |
| id | 1985472 |
| size | 84,080 |
Core TUI primitives for the Fusabi framework.
This crate provides the foundational building blocks for creating terminal user interfaces in the Fusabi ecosystem. It includes primitives for styling, layout, buffering, and rendering terminal content.
This crate is designed to be:
use fusabi_tui_core::{
buffer::{Buffer, Cell},
layout::{Constraint, Direction, Layout, Rect},
style::{Color, Modifier, Style},
};
// Create a buffer for a terminal area
let area = Rect::new(0, 0, 80, 24);
let mut buffer = Buffer::new(area);
// Create a styled cell
let style = Style::new()
.fg(Color::Green)
.bg(Color::Black)
.add_modifier(Modifier::BOLD);
// Write text to the buffer
buffer.set_string(0, 0, "Hello, Fusabi!", style);
// Split the area into sections
let chunks = Layout::default()
.direction(Direction::Vertical)
.constraints(&[
Constraint::Length(3),
Constraint::Fill(1),
Constraint::Length(3),
])
.split(area);
The buffer module provides types for managing a 2D grid of terminal cells:
The layout module provides a constraint-based layout system:
The style module provides rich text styling capabilities:
The symbols module provides Unicode characters for drawing UI elements:
Licensed under either of:
at your option.