Slider
Continuous-value slider with single, range, or N-thumb selection, full keyboard nav, RTL, and orientation support.
At a glance
valueanddefaultValueare always arrays — pass[n]for single-thumb,[low, high]for range,[a, b, c, ...]for multi-thumb pickers.onChangefires continuously while dragging;onValueCommitfires once when the interaction ends.- Web pointer behavior: clicking the track moves the nearest thumb; dragging keeps the cursor captured even if it strays off the thumb.
- Keyboard: arrow keys ±step (axis follows orientation; horizontal honors
dir="rtl"andinverted), PageUp/Down ±10·step (or 10% of range), Home/End to min/max. minStepsBetweenThumbsenforces a gap so adjacent thumbs can't overlap.dir="rtl"flips the visual mapping for horizontal sliders so the higher value sits on the left.- Native: tap-to-position + keyboard work; long-press dragging is a future enhancement on RN.
Preview
Single thumb plus a two-thumb range. Drag, click the track, or tab to a thumb and use the arrow keys.
Multi-thumb
Three or more thumbs work the same way as range. minStepsBetweenThumbs enforces a gap so adjacent thumbs can't pass each other.
Vertical
Higher values sit at the top. Arrow Up / Arrow Down change the value (axis follows orientation).
RTL
dir="rtl" flips the visual mapping so the higher value sits on the left. Arrow Right then decreases the value, matching how a reader expects "right" to behave in the opposite reading direction.
Disabled
min, max, step
The slider's value space. min (default 0) and max (default 100)
bound the legal range; step (default 1) is the increment that
arrow-key changes and snap-on-drag honor. step must divide
max - min cleanly — non-integer steps work for currency / fractional
sliders.
orientation and length
orientation="horizontal" (default) lays the track left-to-right;
vertical runs bottom-to-top. length sets the track size in pixels
along its axis — width for horizontal, height for vertical.
disabled
Greys the track + thumb, blocks pointer + keyboard interaction, and
forwards aria-disabled.
onInteractionStart and onInteractionEnd
Bracket the user's drag / keyboard interaction. onInteractionStart
fires once when the user begins driving the slider (pointer down,
first arrow key); onInteractionEnd fires once when they stop. Pair
with onChange (continuous, every step) and onValueCommit (final
value at end of interaction) when the change is expensive enough to
debounce.
aria-label and ariaLabelForThumb
Slider tracks need an accessible name (aria-label or
aria-labelledby on the slider). For multi-thumb sliders, label each
thumb individually via ariaLabelForThumb — a function that receives
the thumb's index and returns the label string.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
aria-label | string | — | Group-level accessibility label. |
ariaLabelForThumb | (thumbIndex: number) => string | — | Per-thumb label provider — `(index) => string`. Required for multi-thumb sliders to announce sensibly. |
className | string | — | — |
defaultValue | readonly number[] | — | Uncontrolled initial value(s). @defaultValue [0] |
dir | enum | ltr | Reading direction. Affects which end is min/max for horizontal sliders. @defaultValue 'ltr' |
disabled | boolean | false | When true, the slider is non-interactive. |
inverted | boolean | false | Reverse the visual + interaction direction (useful for "less is more" sliders). |
length | number | 200 | Fixed track length when orientation="vertical". @defaultValue 200 |
max | number | 100 | @defaultValue 100 |
min | number | 0 | @defaultValue 0 |
minStepsBetweenThumbs | number | 0 | Multi-thumb spacing — minimum number of `step`s required between adjacent thumbs. @defaultValue 0 |
onChange | (next: number[]) => void | — | Fires continuously while a thumb moves. |
onInteractionEnd | () => void | — | Fires when a pointer/touch releases (pair with `onInteractionStart`). |
onInteractionStart | () => void | — | Fires when a pointer/touch starts driving the slider. Pair with `onInteractionEnd` to toggle a parent ScrollView's `scrollEnabled` — RN's responder system can't preempt UIScrollView's native pan recognizer on iOS, so the canonical fix is for the consumer to disable scroll while the user is actively dragging. |
onValueCommit | (next: number[]) => void | — | Fires when interaction ends (pointer up, key release). |
orientation | enum | horizontal | @defaultValue 'horizontal' |
step | number | 1 | Step size. @defaultValue 1 |
testID | string | — | — |
value | readonly number[] | — | Controlled value(s). For a single-thumb slider pass `[n]`. |