Skip to main content
Also has everything from ElementHandle. A slider. Value is always kept inside [min, max].

Creation

number
required
Lower bound.
number
required
Upper bound.
number
required
Increment for nudge and optional snap.
string?
Text shown before the number.
string?
Text shown after the number, e.g. "%".

SetValue

Set the value. Always clamped into range. Pass true for snapToStep to round to the nearest step.

SetFromAlpha

Set using 0..1 instead of the real range. 0.5 is the middle.

SetFromText

Try to set from a typed-in string. Returns true if the string was valid.

GetAlpha

Current value as 0..1.

Nudge

Bump the value up (+1) or down (-1) by a sensible amount.

SetValueTextOverrides

Show custom text for specific numbers, e.g. { [0] = "Off" } displays “Off” instead of 0.

Example