<slider>
A Material slider that picks a number between min and max, optionally in steps.
<column style="w-full gap-8">
<text style="font-semibold">Volume</text>
<slider id="vol"
name="volume"
min="0"
max="100"
value="60"
divisions="10"
color="teal-600"/>
<text @text="#vol.value + ' of ' + #vol.max"
style="muted"></text>
</column>
Attributes
| Name | What it does | Default |
|---|---|---|
color |
Active color color |
|
divisions |
Number of discrete steps number |
|
label |
Label text string |
|
max |
Maximum value number |
100 |
min |
Minimum value number |
0 |
name |
Variable name for form scoping string |
|
orientation |
vertical runs the track up (min at the bottom); its length is the height the style gives (h-180). horizontal, vertical |
horizontal |
value |
The value shown: a number, or any expression over variables (one-way; name= writes back). expression |
50 |
Readings
| Name | What it does |
|---|---|
divisions |
The divisions= in force; empty when the slider is continuous. |
dragging |
Whether a thumb is being dragged. |
max |
The max= in force. |
min |
The min= in force, as the control resolves it. |
value |
The value shown, live as the thumb moves. |
Any tag also takes gestures: @on.tap, @on.longpress, @on.doubletap and @on.swipeleft (and right, up and down). @click runs on a tap too.