Skip to content

Slider

Native range input with a filled track and optional live value. Keyboard support comes from the browser.

Example

40
<Slider id="volume" label="Volume" value="40" showValue />

Custom range

250
<Slider id="price" label="Max price" min="10" max="1000" step="10" value="250" showValue />

Range

20–80
<Slider id="budget" label="Budget" range valueMin={20} valueMax={80} showValue />

Props

PropTypeDefaultDescription
min / max / stepnumber0 / 100 / 1Range constraints.
valuenumber50Initial value (single mode).
rangebooleanfalseTwo thumbs sharing min / max / step.
valueMin / valueMaxnumber25% / 75%Initial thumb values.
nameMaxstringname + "-max"Form name for the maximum thumb.
showValuebooleanfalseLive <output> next to the track.
classstring-Style passthrough.

Theming

:root {
  --ink-slider-fill: 40%;   /* set by script on input */
}

Accessibility