Bridge between Dioxus Core (reactive components) and Ratatui (terminal rendering). Architecture: retained TuiNode tree + immediate Ratatui render Dioxus VirtualDom → WriteMutations → TuiTree → Frame → Terminal Modules: tree.rs — retained node tree (Element, Text, Placeholder) renderer.rs — WriteMutations impl (14 methods) layout.rs — Dioxus attrs → Ratatui Constraint/Direction style.rs — attrs → Ratatui Style (colors, bold, italic) events.rs — crossterm quit detection render.rs — tree walker → Ratatui widget rendering lib.rs — launch() + event loop + terminal lifecycle Elements: div, p, span, h1-h3, hr Layout: vertical/horizontal split, percentage/length/fill constraints Styling: named colors, hex, bold, italic, underline, dim Events: keyboard quit (Ctrl+C, q) 453 lines. Zero governance/substrate dependencies. Apache 2.0 — pure community crate. Signed-off-by: Tyler King <tking@guildhouse.dev>
15 lines
289 B
Rust
15 lines
289 B
Rust
use dioxus::prelude::*;
|
|
|
|
fn main() {
|
|
dioxus_ratatui::launch(App);
|
|
}
|
|
|
|
fn App() -> Element {
|
|
rsx! {
|
|
div {
|
|
h1 { "Hello from Dioxus + Ratatui!" }
|
|
p { "This is a reactive terminal UI." }
|
|
p { "Press 'q' or Ctrl+C to quit." }
|
|
}
|
|
}
|
|
}
|