
Range slider with single or multi-thumb support.
npx shadcn@latest add https://ui.edbn.me/r/slider.jsonGroups all parts of the slider. Renders a div element.
defaultValuenumber | number[]Initial value(s)
valuenumber | number[]Controlled value(s)
onValueChangefunctionCalled on every change
onValueCommittedfunctionCalled on pointer up / keyboard commit
minnumber0Minimum value
maxnumber100Maximum value
stepnumber1Step increment
largeStepnumber10Step for Page Up/Down
minStepsBetweenValuesnumber0Min distance between range thumbs
orientation'horizontal' | 'vertical''horizontal'Slider orientation
disabledbooleanfalseDisable slider
classNamestring | functionCSS class name
renderReactElement | functionCustom render function
| Attribute | Description |
|---|---|
| data-dragging | Present while a thumb is being dragged |
| data-orientation | Slider orientation |
| data-disabled | Present when slider is disabled |
| data-readonly | Present when slider is read-only |
| Variable | Description |
|---|---|
| --slider-value | Normalized thumb value (0–1) |
| --slider-active-thumb-index | Active thumb index |
The background track. Renders a span element.
classNamestring | functionCSS class name
renderReactElement | functionCustom render function
The filled range between min and the thumb. Renders a span element.
classNamestring | functionCSS class name
renderReactElement | functionCustom render function
The interactive thumb handle. Renders a div element.
classNamestring | functionCSS class name
renderReactElement | functionCustom render function
| Attribute | Description |
|---|---|
| data-dragging | Present while this thumb is being dragged |
| data-index | Thumb index |
| Variable | Description |
|---|---|
| --slider-thumb-value | This thumb's normalized value (0–1) |