| Crates.io | vtui |
| lib.rs | vtui |
| version | 0.2.1 |
| created_at | 2025-12-30 08:54:54.013209+00 |
| updated_at | 2026-01-20 18:54:35.478414+00 |
| description | A simple terminal UI framework |
| homepage | |
| repository | https://github.com/joshprk/vtui |
| max_upload_size | |
| id | 2012318 |
| size | 42,629 |
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.
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);
}