ZigTUI - Terminal User Interface Library

ZigTUI Dashboard Check it on Github


Project Overview: ZigTUI is the first full-featured cross-platform TUI framework for Zig β€” works seamlessly on Windows, Linux, and macOS. Inspired by Ratatui, it provides a simple and composable API for building beautiful, interactive terminal applications.

⭐ 82 stars on GitHub | πŸ‘₯ 50+ users across the Zig community

Features

  • Cross-platform support β€” Windows, Linux, and macOS
  • Cell-based rendering with diff algorithm for efficient updates
  • Constraint-based layouts for flexible UI design
  • Composable widgets β€” Block, Paragraph, List, Gauge, Table
  • Keyboard and mouse event handling
  • ANSI color and text styling support
  • Kitty Graphics Protocol for image display
  • Unicode block fallback for terminals without graphics support
  • Explicit memory management β€” no hidden allocations

Widgets

  1. Block β€” A container with optional border and title
  2. Paragraph β€” Display text with optional wrapping
  3. List β€” A scrollable list of items
  4. Gauge β€” A progress bar component
  5. Table β€” Display tabular data

Graphics Support

ZigTUI now supports image display in terminals using the Kitty Graphics Protocol and more!

Image Display Example

What’s New:

  • Kitty Graphics Protocol implementation for displaying actual images in the terminal
  • Base64 chunked transmission for large images
  • Automatic terminal capability detection
  • Unicode half-block fallback for terminals without graphics support (Windows Terminal, iTerm2, etc.)
  • Built-in BMP decoder for the fallback mode

Terminal Compatibility:

TerminalPlatformKitty Graphics
KittyLinux, macOSFull support
WezTermWindows, Linux, macOSFull support
KonsoleLinuxPartial support
Windows TerminalWindowsFallback mode

Quick Start

const std = @import("std");
const tui = @import("zigtui");

pub fn main() !void {
    var gpa = std.heap.GeneralPurposeAllocator(.{}){};
    defer _ = gpa.deinit();
    const allocator = gpa.allocator();

    var backend = try tui.backend.init(allocator);
    defer backend.deinit();

    var terminal = try tui.terminal.Terminal.init(allocator, backend.interface());
    defer terminal.deinit();

    // Your TUI code here...
}

Requirements

  • Zig 0.15.0 or later
  • Windows 10+ or Linux/macOS with ANSI escape sequence support