Warning
This project is in early development. APIs may change, and bugs may exist.
Terminal UIs have traditionally been painful to build. You either work with low-level escape sequences (error-prone and tedious) or use immediate-mode libraries that require you to manage all state manually. RxTUI takes a different approach.
We bring the retained-mode, component-based architecture that revolutionized web development to the terminal:
- Declarative UI - Describe what your UI should look like, not how to change it
- True Composability - Build complex apps from simple, reusable components
- Best of Both Worlds - Elm's message architecture meets React's components
- TUI Optimizations - Automatic diffing, dirty tracking, and minimal redraws
Add to your Cargo.toml:
[dependencies]
rxtui = "0.1"A simple working example showing separation of state management and UI building:
use rxtui::prelude::*;
#[derive(Component)]
struct Counter;
impl Counter {
    #[update]
    fn update(&self, _ctx: &Context, msg: &str, mut count: i32) -> Action {
        match msg {
            "inc" => Action::update(count + 1),
            "dec" => Action::update(count - 1),
            _ => Action::exit(),
        }
    }
    #[view]
    fn view(&self, ctx: &Context, count: i32) -> Node {
        node! {
            div(
                pad: 2,
                align: center,
                w_frac: 1.0,
                gap: 1,
                @key(up): ctx.handler("inc"),
                @key(down): ctx.handler("dec"),
                @key(esc): ctx.handler("exit")
            ) [
                text(format!("Count: {count}"), color: white, bold),
                text("use ↑/↓ to change, esc to exit", color: bright_black)
            ]
        }
    }
}
fn main() -> std::io::Result<()> {
    App::new()?.run(Counter)
}cargo run 
| Document | Description | 
|---|---|
| Examples | Collection of example apps | 
| Documentation | Complete framework documentation | 
| Tutorial | Step-by-step guide from basics to advanced | 
| API Reference | Detailed API documentation | 
| Quick Reference | Handy cheat sheet for common patterns | 
| Implementation | Internal architecture details | 
Want to contribute? We'd love to have you!
- Development Guide - Set up your dev environment
- Contributing - Contribution guidelines
- GitHub Issues - Report bugs or request features
This project is licensed under the Apache License 2.0.
 
   
  