Repository navigation
What's New
This release migrates tui.zig to Zig 0.17+ with zero C dependencies and introduces a redesigned core runtime, double-buffered cell diff rendering, a constraint-based Ui layout context, deterministic headless snapshot testing, and an expanded 40+ widget suite.
Highlights & Core Architecture
- Zig 0.17+ Toolchain & Zero C Dependencies: Built for Zig
0.17+using native Win32 Console APIs on Windows and native POSIX interfaces (termios,poll,TIOCGWINSZ,SIGWINCH) on Linux, macOS, and BSD—supporting both 32-bit and 64-bit targets without linkingncursesorlibc. - Allocator-Owning
AppRuntime: Initialize once viatui.init(allocator, options)to managefront/backcell buffers, a capacity-retaining scratch arena,EventParser, live terminal window titles (app.setTitle(...)),AppInfometadata (ui.app), and clean terminal mode restoration ondefer app.deinit(). - Flicker-Free Double-Buffered Rendering: Diffs front and back cell grids per frame, writes only modified spans with delta SGR transitions, preserves column alignment for wide CJK and emoji clusters, emits OSC 8 clickable links, and brackets frames with synchronized output (
CSI ? 2026 h/l). - Constraint & Responsive Layout Engine: Partition screens on the stack using
rows,cols, andsplitFixedwith fixed sizes, percentages, ratios, min/max bounds, weighted.fill, flex spacing, edge-merged borders, and responsive breakpoint helpers (ui.isCompact). - Modular Internal Architecture: Reorganized the codebase into unified
core,style,text,event,backend(ansi,capabilities,memory,posix,windows),terminal, andwidgetsmodules, wired withtint(0.0.2) andzigantic(0.0.5).
Widgets, Styling & Internationalization
- 40+ Widgets & Shell Components:
- Navigation & Layout:
Navbar, Left (LTR) / Right (RTL)Sidebar, cascadingDropdownMenu/MenuState(with submenus and checkmarks),StatusBar,Block(edge collapsing, shadows, compact guards),Tabs,Accordion,Stepper,Pagination(sliding page window),Popup, and overflow-safeToastManager. - Text, Inputs & Data: Wrapping paragraphs, Markdown viewer, tables, lists, collapsible
Tree(expandAll/collapseAll), live-validatedTextInput& multi-lineTextArea(with selection and compact border fallback), switches, sliders,Calendar, command palettes,KeyValueList,LogViewer(per-sourceEWIDTtarget matrix and match highlighting),DiffViewer, and an embeddedTerminalView(VtScreenin-memory VT100/ANSI screen buffer). - Charts, Motion & Extensibility: Gauges, sparklines, bar charts, XY
Chart(.area,.step,.line,.scatter,.bar),PieChart(.solid,.segmented,.hud,.rose),Heatmap, vector canvases,Tween/Spring/Transitionmotion primitives,Skeletonloading shimmers,tui.fxbuffer effects, and zero-vtable custom widget dispatch (ui.renderWidgetandui.renderStateful).
- Navigation & Layout:
- OKLCH Colors & 17 Built-In Themes: Supports 24-bit RGB, HSL, HSV, Hex, CSS named colors, and native
Color.oklch, alongside 26 OKLCH color families, perceptual gradient interpolation (palette.gradientColors), automatic degradation to ANSI-256 and ANSI-16 terminals, JSON theme loading, and 17 built-in presets. - Fonts, RTL & Client-Owned Locales: Introduces
text.BitmapFont/BitmapGlyph, RTL visual ordering, grapheme-aware text wrapping, and a client-ownedtext.Localeconfiguration struct. - Inline Scrollback & Headless CI Testing: Supports fullscreen alternate screens, fixed sub-rectangles,
.inline_heightviewports that append to scrollback viainsertBefore, and an in-memory backend for deterministic unit tests andapp.snapshot()/app.snapshotAlloc()verification.
Examples, Documentation & Tooling
- 38 Runnable Examples: Replaced legacy demos with 38 standalone examples (including
app_shell,custom_fonts_and_i18n,custom_event_loop,animations_and_effects, andexamples/advanced/applications), all tested viazig build run-all-examples(--headless). - Rebuilt Documentation: Updated VitePress guides and API references across
docs/api/anddocs/guides/, along with CI workflows,README.md,CONTRIBUTING.md, andSECURITY.md.
Breaking Changes
Note
This release introduces breaking architectural and API changes across the library as part of the Zig 0.17+ migration. Existing applications upgrading to this version will need to update their toolchain and imports accordingly.
- Toolchain Requirement: Minimum supported Zig version is now
0.17+.