Log inGet started
Package

hbox.module

Newest version

This package holds more than this page lists. See all of its files in its world.

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.