Slider

A horizontal slider with one or more thumbs. value is always a number[], so a single-thumb slider holds one entry and a range holds two. Pointer drag and arrow-key stepping are built in.

Basic

A single-thumb controlled slider. Pass value and onValueChange to drive it from state.

Value: 40

Range

Provide two entries in value for a two-thumb range. Thumbs stay ordered, so they never cross.

Range: 2070

Steps

Set step to a coarser interval and pass showStep to draw tick markers along the track. Values snap to the nearest step.

Value: 50

Props

PropTypeDefaultDescription
valuenumber[]Controlled thumb values. One entry per thumb.
defaultValuenumber[][min]Initial values in uncontrolled mode.
onValueChange(value: number[]) => voidCalled when a thumb moves.
minnumber0Minimum value of the track.
maxnumber100Maximum value of the track.
stepnumber1Snap interval for thumb values.
disabledbooleanfalseDisable pointer and keyboard interaction.
showStepbooleanfalseDraw step tick markers along the track.
classNamestringExtra classes on the container.