- π§© Component-Based UI: Buttons, labels, progress bars, bar charts, scatter plots, forms, and more
- π Flexible Layouts: Horizontal/vertical, nested, and percentage-based
- π¨ Custom Components: Easily extend with your own draw logic
- β¨οΈ Keyboard Event Handling: Register callbacks for interactive UIs
- π οΈ Simple API: Clean, modular, and easy to use
Clone the repository and build with make:
git clone https://github.com/Malwarize/ctermui.git
cd ctermui
make#include <ctermui_screen.h>
#include <ctermui_layout.h>
#include <ctermui_component.h>
int main() {
ctermui_screen_t screen = ctermui_screen_init();
ctermui_layout_t root = ctermui_layout_new_root(
CTERMUI_HORIZONTAL, screen->width, screen->height
);
ctermui_component_t label = ctermui_new_text(
"hello_label", "Hello, CTERMUI!", CTERMUI_BRIGHT_CYAN, CTERMUI_EMPTY, CTERMUI_ALIGN_CENTER
);
ctermui_layout_add_component(root, label);
ctermui_screen_set_layout_root(screen, root);
ctermui_screen_loop_start(screen, NULL, 10000);
return 0;
}Explore more in the examples/ directory.
π‘ Pull requests are welcome! Open an issue before major changes.