Scrolling & Navigation Chrome
Build full workstation layouts cleanly using built-in chrome primitives:
Header&StatusBar: Top application banners and bottom multi-segment bars supporting left/right alignment and inverted badges (.badge = true).MenuBar,DropdownMenu&ContextMenu: Horizontal top menu bars, cascading nested submenus (MenuState,MenuGroup,MenuItemwithchildrenandcheckedtoggles), and(x, y)anchored floating shortcut menus with horizontal dividers.Pagination: Sliding-window page bar (�, � Prev … 4 [5] 6 … 12 Next ▶) supporting mouse clicks andLeft/Right/Home/End.LogViewer&DiffViewer: Structured log inspector with per-sourceEWIDTtarget filtering (hkey), substring match highlighting, and follow-tail scrolling, paired with unifiedDiffViewerold/new line numbers.TerminalView(VtScreen): Pure-Zig ANSI/VT100 screen buffer widget supporting SGR 16/256/RGB colors, cursor tracking, and erase sequences.Breadcrumbs&Tabs: Path indicators (Home › Docs › Core) and mouse/keyboard-switchable tab strips (Tabs.handleEvent).ScrollView+Scrollbar: Bordered viewport container rendering a proportionalScrollbaralong the right edge whenevercontent_height > inner.height(Scrollbar.handleEventalso handles direct mouse wheel & track click/drag).Tree+TreeState: Collapsible hierarchical trees using stable path hashing, supportingexpandAll,collapseAll, andconststatic or stack[]const TreeNodedefinitions without mutating node slices.
Cascading DropdownMenu Example
zig
const export_items = [_]tui.MenuItem{
.{ .label = "Plain Text", .id = "export.txt", .shortcut = "1" },
.{ .label = "JSON Snapshot", .id = "export.json", .shortcut = "2" },
};
const file_items = [_]tui.MenuItem{
.{ .label = "New Project", .id = "file.new", .shortcut = "Ctrl+N" },
.{ .label = "Export As", .children = &export_items },
.{ .label = "Word Wrap", .id = "view.wrap", .checked = state.word_wrap },
};
const groups = [_]tui.MenuGroup{
.{ .label = "File", .items = &file_items },
};
try ui.dropdownMenu(.{ .groups = &groups }, &state.menu, bar_area, ui.area);1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13