1. Reference
  2. Forms and input

<slider>

A Material slider that picks a number between min and max, optionally in steps.

Forms and input
slider.ham
<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>
The snippet drawn by Hype Apps on a phone, in light mode The snippet drawn by Hype Apps on a phone, in dark mode
This snippet as Hype Apps draws it on a phone. It follows this page's light or dark theme.

Attributes

NameWhat it doesDefault
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

NameWhat 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.

This page is also Markdown, and all of HAM is in llms.txt.