π¦ Feather-Tui
A Rust rewrite of the terminal UI library I originally wrote in C for my school management project.
β οΈ This is my first-ever Rust project β οΈ
Termui is a simple terminal UI library designed to provide building blocks for text-based user interfaces. It started life as a small C library in my school management system project, aiming to offer an easy-to-use UI framework for terminal applications. Now, Iβm rewriting it in Rust to learn the language and (hopefully) improve both performance and maintainability.
π Progress
- π§ Termui is still under development.
- β Some parts are complete, while others are only partially done.
- β¨ These parts may get refined or improved in the future.
- π For now, theyβre good enough to work with.
π¦ Crates
Comming Soon
π Usage
I am really not unexpected people to actually use this crate. So here is a quick example I made in 5 minutes. (Comments are generated by Claude AI)
// Import the feather_tui library with a shorter alias for convenience
use feather_tui as tui;
// Define a trigger function for detecting the 'w' key press (move up)
// This macro creates a function that checks if the input character is 'w'
tui_trg_new_trigger_func!;
// Define a trigger function for detecting the 's' key press (move down)
tui_trg_new_trigger_func!;
// Define a trigger function for detecting the 'e' key press (selection)
tui_trg_new_trigger_func!;
// Define a trigger function for detecting the 'q' key press (quit application)
tui_trg_new_trigger_func!;
// Define a callback function that will be executed when menu options are selected
// This function expects a u32 argument and prints it to the console
tui_cbk_new_callback_func!;
// Helper function to read a key from input
// Marked as inline for performance optimization
ποΈ Dependencies
bitflags crossterm