Skip to content

Repository files navigation

ZigZag

A TUI framework for Zig.

CI statusLatest releaseMIT licenseZig 0.16.0

Features · How it works · Quick start · Components · Examples · Reference

ZigZag component showcase

ZigZag brings typed Model-Update-View applications, rich styling, flexible layout, and 40+ components to the terminal with no third-party dependencies.

Features

CapabilityHighlights
ArchitectureTyped Model-Update-View, commands, async tasks, sub-programs
Components40+ inputs, tables, lists, charts, forms, and overlays
StylingANSI, 256-color, TrueColor, adaptive themes, borders, and text overflow
LayoutPlacement, Flexbox constraints, split panes, and layered composition
Terminal supportKeyboard, mouse, clipboard, images, suspend/resume
PerformanceDiff rendering, ANSI compression, and virtual lists

How it works

Events update the model, then view renders the next terminal frame.

flowchart LR
E["Input · timer · async"] --> U["update"]
U --> M["Model"]
M --> V["view"]
V --> T["Terminal"]
U --> C["Command"]
C --> E
Loading

Quick start

Requires Zig 0.16.0 or newer.

zig fetch --save git+https://github.com/meszmate/zigzag#main
constzigzag=b.dependency("zigzag", .{
.target=target,
.optimize=optimize,
});
exe.root_module.addImport("zigzag", zigzag.module("zigzag"));

Start with the counter example.

Components

CategoryIncludes
Input and formsText input, text area, checkbox, radio group, slider, dropdown, form, file picker, stepper
Data and navigationList, virtual list, table, sortable table, data table, tree, tabs, breadcrumbs, screen stacks
VisualizationProgress, spinner, gauge, sparkline, chart, bar chart, heatmap, canvas, Braille canvas
Overlays and feedbackModal, confirmation, tooltip, notification, toast, context menu, command palette
Content and toolingMarkdown, code view, diff view, rich log, status bar, help, developer console

Browse the component index →

Examples

DemoRun
Showcasezig build run-showcase
Dashboardzig build run-dashboard
File browserzig build run-file_browser
WebAssemblyzig build run-wasm_app

See every example →

Documentation

Reference · Examples · Contributing

Projects using ZigZag

  • zmenu, a simple Zig application launcher for GNU/Linux

Star ZigZag ⭐

If ZigZag helps you build a terminal application, consider starring the repository. Stars help other Zig developers discover the project, show that the framework is useful, and motivate continued work on components, terminal support, and documentation.

License

MIT

About

A Terminal UI framework for Zig

Topics

Resources

Contributing

Stars

534 stars

Watchers

6 watching

Forks

Releases

Contributors

Languages