RangeSlider
Two thumbs bounding a range. Both are real focusable sliders and they swap rather than block.
Signature
Density
Viewport
Theme and light/dark are set in the top barWhen to use
Two thumbs bounding a range.
Accessibility
Fully keyboard operable: Tab to focus, Enter/Space to activate. The visible focus ring uses --focus-ring — never remove it. Provide an accessible label (aria-label) for icon-only controls.
Install and import
npx shadcn@latest add @prism/range-slider
import { RangeSlider } from '@/components/prism/RangeSlider';
In a no-build prototype, read it from the bundle instead: const { RangeSlider } = window.PrismDesignSystem_39d121;
Props
| Prop | Type | Required | Description |
|---|---|---|---|
label | React.ReactNode | — | |
value | [number, number] | — | [low, high] — always returned sorted, because the thumbs may cross. |
min | number | — | |
max | number | — | |
step | number | — | |
formatValue | (v: number) => React.ReactNode | — | |
onChange | (value: [number, number]) => void | — | |
isDisabled | boolean | — | |
className | string | — |