6 releases
Uses new Rust 2024
| 0.2.1 | Jan 20, 2026 |
|---|---|
| 0.2.0 | Jan 20, 2026 |
| 0.1.0 | Jan 12, 2026 |
| 0.1.0-alpha | Dec 30, 2025 |
#1466 in Command-line interface
Used in vtui
30KB
972 lines
About
vtui is the framework for sophisticated full-stack terminal applications.
It provides basic building blocks that often come up as boilerplate, from a high-performance runtime to complex UI features like scrolling.
Usage
use ratatui::style::Style;
use vtui::{events::*, input::*, prelude::*};
#[component]
fn App(c: Component) -> Node {
let mut clicks = c.state(0);
c.draw(move |canvas| {
let text = format!("Clicks: {}", *clicks.read());
canvas.text(0, 0, text, Style::default());
});
c.listen::<MouseDown>(move |event| {
if event.button == MouseButton::Left {
*clicks.write() += 1;
}
});
c.listen::<KeyPress>(|event| {
if event.key == KeyCode::Char('q') {
event.request_shutdown();
}
});
vtui! {}
}
fn main() {
vtui::launch(App);
}
Dependencies
~15MB
~181K SLoC