Slider

A native range input. Keyboard, touch and form behaviour come free; the filled track is painted from the value.

Examples

Basic

Volume: 50

Show code
<Slider label="Volume" min={0} max={100} bind:value={volume} />

Steps and disabled

Budget: $300

Show code
<Slider label="Budget" min={100} max={1000} step={50} bind:value={budget} />
<Slider label="Disabled" value={40} disabled />

Props

PropTypeDefaultDescription
labelstring—Label above the track.
valuenumber0Current value. Bind it with bind:value.

min, max, step, name and every other native range attribute are forwarded. Use bind:value to read the number back.