Expand description
§weavetui
A simple TUI framework for building elegant and responsive terminal applications.
weavetui is built on top of ratatui and tokio, providing a component-based
architecture that simplifies the development of complex TUIs.
§Features
- Component-Based: Build your UI from reusable components.
- Declarative Macros: Use the
#[component]macro to reduce boilerplate. - Async Event Handling: Powered by
tokiofor non-blocking event processing. - Keybinding System: A simple and flexible keybinding system.
§Getting Started
To get started, add weavetui to your Cargo.toml:
[dependencies]
weavetui = "0.1.0"Then, create a simple application:
use weavetui::prelude::*;
#[component(default)]
struct MyComponent;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let mut app = App::new([("<q>", "app:quit")], vec![Box::new(MyComponent::default())]);
app.run().await?;
Ok(())
}Modules§
Macros§
- components
- Creates a vector of components from a list of component instances.
- kb
- Creates an array of keybindings.
Traits§
- Component
- The main trait for all UI components in the
weavetuiframework. - Component
Accessor - A trait that provides access to the basic properties of a component.
Attribute Macros§
- component
- Implements the
weavetui_core::Componentandweavetui_core::ComponentAccessortraits for a struct, turning it into aweavetuicomponent.