Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commitdd348ac6c3

README.md

hbox

Horizontal layout container. Children laid out left-to-right; spacing via style.gap; alignment via style.align ("start" | "center" | "end").

Exports

  • hbox(children: { WidgetNode }?, opts: HboxOpts?) -> WidgetNode — build a horizontal-layout container.

Types:

  • HboxOpts = { 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 row = Z.hbox({ Z.lbl("a"), Z.lbl("b") }, {
    style = { gap = 6, align = "center" },
})

Notes

  • Pure builder over modules.zui.widget.node — no state, no engine calls. Safe at module load.
  • children defaults to {} when nil so an empty hbox is a no-op.
  • style.gap is the inter-child spacing in pixels; style.align controls cross-axis alignment.