Builtin Library
README.md
grid
Fixed-column grid container. Children flow left-to-right then wrap.
columns is required.
Exports
grid(children: { WidgetNode }?, columns: number, opts: GridOpts?) -> WidgetNode— build a fixed-column grid container.
Types:
GridOpts = { id: string?, classes: (string | { string })?, props: { [string]: any }?, style: { [string]: any }? }WidgetNode = { [string]: any }— widget table (interoperable with hand-written widget trees).
Usage
local Z = require("@builtin::modules.zui")
local g = Z.grid({ a, b, c, d }, 2, { style = { gap = 4 } })
Notes
- Pure builder — no state, no engine calls. Safe at module load.
childrendefaults to{}when nil;columnshas no default and must be provided.- The
columnsvalue is forwarded to the engine asprops.columns; any other props the caller passes survive untouched.