Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commitdd348ac6c3

README.md

slider

Horizontal slider for a numeric value in [min, max]. Emits the given onChange callback id with data.value set to the new value. Pass step to constrain to discrete increments.

Exports

  • slider(id: string, value: number?, lo: number?, hi: number?, opts: SliderOpts?) -> any — build a horizontal slider widget. The module returns this function directly.

Types:

  • SliderOpts = { props: { [string]: any }?, style: { [string]: any }?, onChange: string?, step: number? }

Usage

local slider = require("@builtin::modules.zui.widget.slider")
slider("volume", 0.5, 0, 1, { onChange = "ui:volume:change", step = 0.05 })

Notes

  • value, lo, hi all default to 0, 0, 1 respectively when nil.
  • onChange callbacks fire with data.value set to the new numeric value; route them via component.onCallback or a Z.app router.