| asChild | boolean | false | headless | Render the child element in place of the default <span> via the
Slot pattern, merging Slider.Root's dir, data-* hooks,
pointer handler, and ref onto it. |
| defaultValue | number[] | — | headless | The value array on first render — one number per
SliderThumb, in order ([value] for a single
thumb, [low, high] for a range). After mount the component owns the
value. Defaults to [min] when omitted.
Forbidden in controlled mode — use value instead. |
| dir | "ltr" | "rtl" | — | headless | Reading direction of a horizontal slider; see SliderDirection.
Affects which end is the minimum, the arrow-key direction, pointer
mapping, and the inline positioning styles. When omitted, it is inherited
from the nearest DirectionProvider, falling back to "ltr" when
there is no provider; an explicit prop always wins. |
| disabled | boolean | false | headless | Disable all interaction. Every part receives data-disabled="", thumbs
leave the tab order and gain aria-disabled="true", and both keyboard and
pointer handlers become no-ops. |
| inverted | boolean | false | headless | Reverse the direction the value increases along the axis. Combines with
SliderRootSharedProps.orientation`orientation` and
SliderRootSharedProps.dir`dir` to flip the pointer mapping,
arrow keys, and the edge the thumb/range offset is anchored to. |
| max | number | 100 | headless | Highest value the slider can take — the value at the track's end edge.
Must be strictly greater than SliderRootSharedProps.min`min`;
Slider.Root throws during render otherwise. |
| min | number | 0 | headless | Lowest value the slider can take — the value at the track's start edge.
Must be strictly less than SliderRootSharedProps.max`max`;
Slider.Root throws during render otherwise. |
| minStepsBetweenThumbs | number | 0 | headless | Minimum gap, expressed in steps, enforced between adjacent thumbs on a
multi-thumb slider. The gap in value units is minStepsBetweenThumbs *
step. A thumb is clamped so it can never come closer than this to its
neighbours (and can never cross them). Has no effect on a single-thumb
slider. |
| name | string | — | headless | When set, Slider.Root renders one hidden <input> per thumb carrying
that thumb's value so the slider posts with a surrounding <form>. A
multi-thumb slider suffixes the name with [] (e.g. name="range" →
range[]); a single-thumb slider uses the bare name. When omitted, no
hidden inputs are rendered. |
| onValueChange | (value: number[]) => void | — | headless | Called with the full next value array on every change (each arrow-key
press and every pointer increment during a drag). Optional in
uncontrolled mode.
Called with the full next value array on every change (each arrow-key
press and every pointer increment during a drag). Update value from it
to keep the slider in sync. |
| onValueCommit | (value: number[]) => void | — | headless | Called once with the settled value array when an interaction ends — a
pointer release, or a completed keyboard press. Use it to persist only the
final value rather than every intermediate step. |
| orientation | "horizontal" | "vertical" | "horizontal" | headless | Layout axis of the track; see SliderOrientation. Sets
data-orientation and each thumb's aria-orientation, and selects which
pointer axis and arrow keys drive the value. |
| step | number | 1 | headless | Granularity of the value: every thumb value snaps to a multiple of step
anchored at min, and each arrow-key press moves by one step (Page
Up/Down move by ten). Fractional steps (e.g. 0.1) are snapped to the
step's decimal precision. Must be greater than 0; Slider.Root throws
during render otherwise. |
| value | number[] | — | headless | Forbidden in uncontrolled mode — use defaultValue instead.
The current value array — one number per
SliderThumb, in order ([value] for a single
thumb, [low, high] for a range). Must be kept in sync by the parent via
onValueChange. |
| size | "xs" | "sm" | "md" | "lg" | "xl" | md | styled | Track thickness + thumb size; data-density scales each size further. |