Builtin Library
README.md
scroll
Scrollable container. Pass maxHeight (or maxWidth) to bound the
visible region; children beyond that get scrolled. Top-level shortcuts
maxHeight / maxWidth / minHeight / minWidth / stickToBottom
merge into style / props so the common case doesn't require nesting
under style = { ... }.
Exports
scroll(children: any?, opts: ScrollOpts?) -> any— build a scrollable container. The module returns this function directly.
Types:
ScrollOpts = { id?, classes?, props?, style?, maxHeight?, maxWidth?, minHeight?, minWidth?, stickToBottom? }
Usage
local scroll = require("@builtin::modules.zui.widget.scroll")
-- Shortcut form (preferred):
scroll(rows, { maxHeight = 200 })
-- Equivalent verbose form:
scroll(rows, { style = { maxHeight = 200 } })
For tall content inside Z.panel, prefer Z.panel(rows, { scroll = true, maxHeight = N }) — see the panel README
for the pattern documented under issue #3270.
Notes
- Either a single widget table or an array of widgets is accepted as
children— single widgets do not need to be wrapped in{ ... }(closes #2331). - Without a
maxHeight/maxWidth(top-level orstyle.*), the scroll area fills the parent's available rect and scrolls on overflow (renderer appliesauto_shrink([false, false])in that case). With a bound, the scrollArea sizes to it and scrolls past that bound.