Jump to a page or a component.
Scalar slider on the progress anatomy; the thumb sits in the gap.
No install — ask an AI agent to copy this component from registry.json.
import { Slider, sliderVariants, sliderThumbVariants } from "@/components/ui/slider";value is a number and onValueChange hands you a number, not an array.${testId}-thumb, the one node a caller cannot otherwise reach.The props worth knowing. Everything else passes straight through to the underlying element, including className, which is merged last so it always wins.
| Prop | Type | Default | Description |
|---|---|---|---|
| value | number | — | Current value, controlled form. |
| defaultValue | number | min | Starting value, uncontrolled form. |
| onValueChange | (value: number) => void | — | Every step while dragging. |
| onValueCommit | (value: number) => void | — | Once, when the drag or key repeat ends. |
| min / max / step | number | 0 / 100 / 1 | Range and increment. |
| label | ReactNode | — | Header copy, and the thumb's accessible name via aria-labelledby. |
| formatValue | (value: number, max: number) => string | rounded percentage | Readout string. Override for units — v.toFixed(1), `${v}px`. |
| size | "sm" | "default" | "lg" | "default" | Track height, gap, pip and thumb capsule. |