Slider
Selects a value, or a range, from a continuous span.
- Forms
- 1 file
- 1 npm package
- Accessibility notes
Loading the example…
pnpm dlx @dowel-ui/cli add slidernpm packages installed: radix-ui.
import { Slider } from "@/components/ui/slider";Default
With Value
Range
Steps
Disabled
Vertical
<Slider>
| Prop | Type | Default |
|---|---|---|
thumbLabelsAccessible name per thumb, in order. A range slider is two independent | string[] | — |
thumbValueTextsSpoken value per thumb, in order, for values whose raw number is not meaningful on its own — a price, a duration, a rating. | string[] | — |
Every prop of Radix UI’s Slider.Root, plus className.
Each thumb is a role="slider" with arrow keys, Home/End and Page Up/Down. The name is forwarded onto the thumbs, since the root has no role — a range slider should name each thumb separately with thumbLabels. A development-only warning fires if a thumb would be unnamed. Pass aria-valuetext when the raw number is not meaningful on its own (a price, a duration). Show the current value on screen too — a slider is imprecise, so pair it with a numeric input when exactness matters.
10/10
checks passed
- Tested — passes
- axe assertion — passes
- Keyboard tested — passes
- Storybook examples — passes
- Accessibility documented — passes
- Semantic tokens only — passes
- Motion from tokens — passes
- className merged — passes
- Visible focus — passes
- No fixed widths — passes