Skip to content

Latest commit

Β 

History

History
93 lines (67 loc) Β· 2.63 KB

File metadata and controls

93 lines (67 loc) Β· 2.63 KB
CTERMUI Logo

πŸ–₯️ Build Modern Terminal UIs in C

GitHub release GitHub license GitHub issues GitHub stars GitHub forks GitHub watchers

✨ Create interactive, component-based terminal applications with ease.


πŸ—ΊοΈ Table of Contents


⚑ Features

  • 🧩 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

πŸ“¦ Installation

Clone the repository and build with make:

git clone https://github.com/Malwarize/ctermui.git
cd ctermui
make

πŸš€ Usage

Minimal Example

#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;
}

πŸ“Œ Examples

Explore more in the examples/ directory.


🀝 Contributing

πŸ’‘ Pull requests are welcome! Open an issue before major changes.