feather_tui/
lib.rs

1//! Feather-Tui is a simple terminal UI library designed to provide building blocks
2//! for text-based user interfaces. It started life as a small C library in my
3//! school management system project, aiming to offer an easy-to-use UI framework
4//! for terminal applications. Now, I’m rewriting it in Rust to learn the language
5//! and (hopefully) improve both performance and maintainability.
6
7/// Core building blocks for constructing user interfaces.
8pub mod components;
9/// A generic callback handler for executing functions with stored arguments.
10pub mod callback;
11/// A generic trigger handler for evaluating conditions based on stored arguments.
12pub mod trigger;
13/// Used within a `Container` to navigate and select `Option`. 
14pub mod selector;
15/// Acts as a layout manager for the UI elements.
16pub mod container;
17/// Responsible for rendering the UI to the terminal.
18pub mod renderer;
19/// Handles user input, non-blocking key events, and key code conversions with crossterm.
20pub mod input;
21/// Provides custom error types and a result type alias for error handling in `Feather-TUI`.
22pub mod error;
23
24mod     util;
25
26pub use components as cpn;
27pub use callback   as cbk;
28pub use trigger    as trg;
29pub use selector   as slc;
30pub use container  as con;
31pub use renderer   as ren;
32pub use input      as inp;
33pub use error      as err;
34
35#[cfg(feature = "reduce_abstraction")]
36pub use cpn::{Header, Option, Text, TextFlags};
37
38#[cfg(feature = "reduce_abstraction")]
39pub use cbk::Callback;
40
41#[cfg(feature = "reduce_abstraction")]
42pub use trg::Trigger;
43
44#[cfg(feature = "reduce_abstraction")]
45pub use slc::Selector;
46
47#[cfg(feature = "reduce_abstraction")]
48pub use con::Container;
49
50#[cfg(feature = "reduce_abstraction")]
51pub use ren::Renderer;
52
53#[cfg(feature = "reduce_abstraction")]
54pub use inp::{line, key, keycode_to_char, key_char};
55
56#[cfg(feature = "reduce_abstraction")]
57pub use err::{FtuiError, FtuiResult};