A range input for selecting numeric values. Supports single value, range selection, step marks, and both horizontal and vertical orientations.
import Slider from "@radui/ui/Slider"- Single value or a range with several thumbs; thumbs can push, swap or stop at each other
- Arrow keys step, Shift steps by largeStep, PageUp and PageDown step by a multiple, Home and End jump
- Horizontal or vertical, with step marks and custom marks
- Each thumb submits its value through a hidden input and is announced with aria-valuetext
- onValueChange fires while dragging; onValueCommit fires when the drag ends
Import all parts of the component and piece them together.
The root Slider component.
| Prop | Type | Default |
|---|---|---|
value | number | number[] | — |
defaultValue | number | number[] | — |
min | number | 0 |
max | number | 100 |
step | number | 1 |
pageStepMultiplier | number | 10 |
thumbAlignment | 'center' | 'edge' | 'center' |
minStepsBetweenValues | number | 0 |
orientation | enum | horizontal |
disabled | boolean | false |
showStepMarks | boolean | false |
formatValue | function | — |
onValueChange | function | — |
onValueCommit | function | — |
thumbCollisionBehavior | "none" | "push" | "swap" | "none" |
format | Intl.NumberFormatOptions | — |
locale | Intl.LocalesArgument | — |
largeStep | number | step × 10 |
form | string | — |
An <output> showing the current value formatted with the root's formatValue; a range slider shows both values.
| Prop | Type | Default |
|---|---|---|
children | (formatted: string[], values: number[]) => ReactNode | — |
| Shortcut | Description |
|---|---|
| Tab | Moves focus to the slider thumb. |
| ArrowRight | Increases the value by one step in left-to-right layouts and decreases it in right-to-left layouts. |
| ArrowUp | Increases the value by one step. |
| ArrowLeft | Decreases the value by one step in left-to-right layouts and increases it in right-to-left layouts. |
| ArrowDown | Decreases the value by one step. |
| Home | Moves the focused thumb to the minimum value. |
| End | Moves the focused thumb to the maximum value. |
| PageUp | For a single-thumb Slider, increases the value by step multiplied by pageStepMultiplier. |
| PageDown | For a single-thumb Slider, decreases the value by step multiplied by pageStepMultiplier. |
| Reference | What Rad UI follows |
|---|---|
| Slider pattern | Uses slider semantics on each focusable thumb with value range attributes, orientation, and optional aria-valuetext from formatValue. |