Expand description
Core library for the weavetui TUI framework.
This crate defines the fundamental traits and types for building interactive
Text User Interface (TUI) components, including Component for rendering
and event handling, and ComponentAccessor for managing component properties
and children.
It provides the building blocks for the weavetui ecosystem, designed to be
used in conjunction with the weavetui_derive crate for declarative component
creation.
Re-exports§
pub use internal::ComponentContext;
Modules§
- app
- Application module for
weavetui. - component_
manager - This module provides utility functions for managing
Componentinstances, including drawing, updating, event handling, and theme propagation across the component tree. - event
- This module defines the
EventandActionenums, which are central to the application’s event-driven architecture.Eventrepresents raw input from the terminal or internal application occurrences, whileActionrepresents a processed command that can be dispatched and handled by components. - internal
- This module contains internal structures and types used within the
weavetui_corecrate, primarily for managing component state and context. These types are generally not intended for direct public consumption but are essential for the framework’s internal workings. - keyboard
- This module provides utilities for handling keyboard input, including parsing key event strings into
KeyEventsequences and managing keybindings for the application. It allows for flexible definition and lookup of actions based on user input. - macros
- This module contains convenience macros for the
weavetuiframework, simplifying the creation of keybindings and component collections. These macros reduce boilerplate and improve readability when setting up application components and their interactions. - theme
- This module defines structures and utilities for managing themes within the
weavetuiframework. It providesThemeto encapsulate styles and colors, andThemeManagerto handle multiple themes and their application to UI components. - tui
- This module provides the
Tuistruct, which is responsible for managing the terminal user interface. It handles initialization, event polling, rendering, and cleanup of the terminal, acting as the bridge between the application logic and thecrossterm/ratatuibackend.
Macros§
- components
- Creates a vector of components from a list of component instances.
- kb
- Creates an array of keybindings.
Structs§
- Component
Handler - A handler for managing the lifecycle of a component.
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.
Type Aliases§
- Children
- A type alias for a
BTreeMapthat stores child components.