Crate weavetui

Crate weavetui 

Source
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 tokio for 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§

app
Application module for weavetui.
event
keyboard
prelude
A prelude for weavetui applications.
tui

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 weavetui framework.
ComponentAccessor
A trait that provides access to the basic properties of a component.

Attribute Macros§

component
Implements the weavetui_core::Component and weavetui_core::ComponentAccessor traits for a struct, turning it into a weavetui component.