Builtin Library
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,hiall default to0,0,1respectively when nil.onChangecallbacks fire withdata.valueset to the new numeric value; route them viacomponent.onCallbackor aZ.approuter.