Slider
Pointer and keyboard multi-thumb slider with range fill, vertical layout, controlled values, and RTL mirroring.
Installation#
pnpm dlx shadcn@latest add @davinciui/sliderUsage#
API Reference#
| Prop | Type | Default |
|---|---|---|
valueControlled value; array enables multiple thumbs. | number | number[] | — |
defaultValueUncontrolled initial value. | number | number[] | 50 |
onValueChangeFires with the snapped value on every change. | (value: number | number[]) => void | — |
minMinimum. | number | 0 |
maxMaximum. | number | 100 |
stepStep snapping. | number | 1 |
orientationTrack direction. | "horizontal" | "vertical" | "horizontal" |
disabledDisable all interaction. | boolean | false |
ariaLabelAccessible label, one per thumb. | string | string[] | "Value" |
dirMirrors horizontal fill, thumbs, and arrows. | "ltr" | "rtl" | "ltr" |
classNameExtra classes for the root. | string | — |
Accessibility#
Each thumb is a focusable role slider with aria-valuemin, aria-valuemax, aria-valuenow, orientation, and configurable labels. Arrow keys step, PageUp and PageDown move ten steps, Home and End jump to bounds, and RTL reverses horizontal arrows.
Motion#
Only the thumb press scale and transform transition animate; the fill and thumb position change instantly with the value. Timing comes from CSS defaults, and prefers-reduced-motion is not detected.
View source
Keep in mind
Need a custom component?
I build bespoke UI components & websites tailored to your brand.

