Skip to content

Repository files navigation

TUIX - Terminal User Interface eXtensions

TUIX is a modern, header-only C++ library for creating beautiful and interactive terminal user interfaces. It provides a collection of components and utilities for formatting text, creating boxes and tables, displaying progress bars and spinners, handling user input, and more.

Features

  • Text Formatting: Colors, styles (bold, italic, underline), and alignment
  • UI Components: Boxes, tables, progress bars, spinners, and lists
  • Logging System: Colored output with different log levels and timestamps
  • User Input: Prompts for text input, confirmations, and selections
  • Terminal Control: Cursor movement, screen clearing, and terminal size detection
  • Markdown Rendering: Simple markdown-like text formatting
  • Theme System: Consistent styling across components

Requirements

  • C++17 compatible compiler
  • CMake 3.14 or higher (for building with CMake)

Installation

Header-Only

TUIX is a header-only library, so you can simply copy the include/tuix directory to your project and include the headers you need.

#include <tuix/tuix.hpp>  // Include all components
// Or include specific components
#include <tuix/color.hpp>
#include <tuix/box.hpp>

Using CMake

# Clone the repository
git clone https://github.com/yourusername/TUIX.git
cd TUIX

# Configure and build
mkdir build && cd build
cmake ..
make

# Install (optional)
make install

Then in your CMakeLists.txt:

find_package(tuix REQUIRED)
target_link_libraries(your_target PRIVATE tuix::tuix)

Quick Start

#include <tuix/tuix.hpp>
#include <iostream>

using namespace tuix;

int main() {
    // Print a title
    print_title("Welcome to TUIX!", 50);
    
    // Create a box with a title
    box info_box("TUIX is a modern C++ library for terminal UIs.");
    info_box.set_title("About").set_style(box_style::rounded);
    std::cout << info_box << "\n";
    
    // Create a simple table
    table t;
    t.set_headers({"Name", "Type", "Description"})
     .add_row({"box", "Component", "Creates framed text boxes"})
     .add_row({"table", "Component", "Creates formatted tables"})
     .add_row({"progress_bar", "Component", "Shows progress indication"});
    std::cout << t << "\n";
    
    // Show a progress bar
    progress_bar pb(40);
    pb.set_prefix("Loading: ");
    for (int i = 0; i <= 100; i += 10) {
        pb.print(i / 100.0);
        std::this_thread::sleep_for(std::chrono::milliseconds(100));
    }
    pb.finish();
    
    // Log some messages
    log_info("TUIX initialized successfully");
    log_success("Ready to create beautiful terminal UIs!");
    
    return 0;
}

Documentation

For detailed documentation and examples, see the docs directory or visit the project website.

Examples

The examples directory contains several examples demonstrating different features of the library:

Build the examples with CMake:

cmake .. -DTUIX_BUILD_EXAMPLES=ON
make

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Acknowledgements

  • Inspired by various terminal UI libraries and tools
  • Thanks to all contributors and users of the library

About

TUIX is a headerOnly C++ library for creating beautiful and interactive terminal user interfaces. It provides a collection of components and utilities for formatting text, creating boxes and tables, displaying progress bars and spinners and handling user input

Topics

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages