Builtin Library
README.md
statRow
Label-value row — [label] [value] — with consistent label width,
theme-token defaults, and an optional value class/color. Used wherever
a stats panel hand-rolls a tiny Z.hbox(label, value) (runtime /
profiler / physics tabs).
value may be a string/number (rendered as a label) or a widget table
(rendered as-is — e.g. Z.statusLabel).
Exports
statRow(labelText: any, value: any, opts: StatRowOpts?) -> any— build a label-value row widget. The module returns this function directly.
Types:
StatRowOpts = { id: string?, class: (string | { string })?, fontSize: number?, labelWidth: number?, labelMinWidth: number?, labelColor: string?, labelClass: (string | { string })?, valueColor: string?, valueClass: (string | { string })?, bold: boolean?, gap: number?, align: string?, padding: any? }
Usage
local statRow = require("@builtin::modules.zui.widget.statRow")
statRow("Heap allocated", "12.4 MB", {
labelWidth = 140, valueClass = "debug-good", fontSize = 11,
})
statRow("Frame", Z.statusLabel(dtMs, { good = 16, warn = 33 }))
Notes
- Label width defaults to 140 px, font size to 11.
- Label / value colors fall back to the active theme's
text_dim/texttokens respectively. - The value slot accepts a widget table directly, which is the idiomatic way to inline status-coloured values.