Radical TUI - Terminal User Interface Framework
A reactive terminal UI framework inspired by React's virtual DOM architecture. Provides a declarative API for building interactive terminal applications.
Architecture Overview
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Elements │────▶│ Node │────▶│ VDom │
│ Factory │ │ Tree │ │ State │
└─────────────┘ └─────────────┘ └─────────────┘
│ │ │
│ │ │
▼ ▼ ▼
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Style │ │ Diff │────▶│ Render │
│ System │ │ Engine │ │ Engine │
└─────────────┘ └─────────────┘ └─────────────┘
│
▼
┌─────────────┐
│ Terminal │
│ Output │
└─────────────┘
Quick Start
use ;
// Create UI elements using the Elements factory
let ui = div
.background
.padding
.children
.into;
Key Components
- Node: Virtual representation of UI elements (Element trait objects or Text)
- Elements: Factory for creating concrete element types (Div, etc.)
- Element: Trait for element data access (props, children)
- ElementBuilder: Trait providing fluent builder API for elements
- VDom: Manages the virtual DOM state and updates
- Diff: Calculates minimal changes between UI states
- Render: Translates virtual nodes to terminal output
- App: Main application lifecycle and event loop
- Model: Type-safe init-view-update architecture for stateful models