https://github.com/zerocore-ai/rxtui
reactive terminal interfaces for Rust. because CLIs deserve better.
https://github.com/zerocore-ai/rxtui
cli rust terminal tui
Last synced: 3 months ago
JSON representation
reactive terminal interfaces for Rust. because CLIs deserve better.
- Host: GitHub
- URL: https://github.com/zerocore-ai/rxtui
- Owner: zerocore-ai
- License: apache-2.0
- Created: 2025-08-21T12:48:59.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-12-30T06:05:10.000Z (4 months ago)
- Last Synced: 2026-01-14T01:09:30.351Z (4 months ago)
- Topics: cli, rust, terminal, tui
- Language: Rust
- Homepage:
- Size: 711 KB
- Stars: 311
- Watchers: 1
- Forks: 12
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
> [!WARNING]
>
> This project is in early development. APIs may change, and bugs may exist.
# WHY RXTUI?
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:
- [x] **Declarative UI** - Describe what your UI should look like, not how to change it
- [x] **True Composability** - Build complex apps from simple, reusable components
- [x] **Best of Both Worlds** - Elm's message architecture meets React's components
- [x] **TUI Optimizations** - Automatic diffing, dirty tracking, and minimal redraws
- [x] **Inline Mode** - Render directly in terminal with persistent output for CLI tools
# QUICK START
### 1 Install RxTUI
Add to your `Cargo.toml`:
```toml
[dependencies]
rxtui = "0.1"
```
### 2 Create Your First App
A simple working example showing separation of state management and UI building:
```rust
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)
}
```
### 3 Run Your App
```bash
cargo run
```

• • •
# DOCUMENTATION
| Document | Description |
| ----------------------------------------- | ------------------------------------------ |
| **[Examples](./examples)** | Collection of example apps |
| **[Documentation](DOCS.md)** | Complete framework documentation |
| **[Tutorial](TUTORIAL.md)** | Step-by-step guide from basics to advanced |
| **[API Reference](API_REFERENCE.md)** | Detailed API documentation |
| **[Quick Reference](QUICK_REFERENCE.md)** | Handy cheat sheet for common patterns |
| **[Implementation](IMPLEMENTATION.md)** | Internal architecture details |
• • •
# DEVELOPMENT
Want to contribute? We'd love to have you!
- **[Development Guide](DEVELOPMENT.md)** - Set up your dev environment
- **[Contributing](CONTRIBUTING.md)** - Contribution guidelines
- **[GitHub Issues](https://github.com/microsandbox/rxtui/issues)** - Report bugs or request features
• • •
# LICENSE
This project is licensed under the [Apache License 2.0](./LICENSE).