Builtin Library
README.md
sides
Two-slot horizontal row that anchors the first child left, the second child right, and stretches a flexible gap between them. Designed for window title bars, toolbars, status footers — any "title left, controls right" pattern.
Exports
sides(opts: SidesOpts?) -> any— build a two-slot left/right row. The module returns this function directly.
Types:
SidesOpts = { left: any?, right: any?, [number]: any, id: string?, style: { [string]: any }? }
Usage
local sides = require("@builtin::modules.zui.widget.sides")
-- Positional shape
sides({ leftWidget, rightWidget })
-- Named-slot shape
sides({
left = Z.hbox({ Z.lbl("◆"), Z.lbl("zero") }),
right = Z.hbox({ Z.iconBtn("─"), Z.iconBtn("□"), Z.iconBtn("✕") }),
})
Notes
- When more than two widgets are needed on either side, wrap them in a
layout container first (
Z.hbox/Z.vbox). - Implemented as an
hboxcontaining[left, flex(), right]; the flex-grow spacer makes the right slot hug the row's right edge. - Children render in source order on both sides.