Log inGet started
Package

scroll.module

Newest version

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

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 or style.*), the scroll area fills the parent's available rect and scrolls on overflow (renderer applies auto_shrink([false, false]) in that case). With a bound, the scrollArea sizes to it and scrolls past that bound.