Slider
A draggable range input.
Installation
bash
npx shadcn@latest add sliderImport
import { Slider } from "@/components/ui/slider"Default
Range (Two Handles)
Controlled with value display
Value: 50
Controlled range with display
25 – 75
Disabled
Props
PROPTYPEDEFAULTDESCRIPTION
defaultValuenumber[][0]Initial value (uncontrolled)valuenumber[]—Controlled valueonValueChange(value: number[]) => void—Called when value changesminnumber0Minimum valuemaxnumber100Maximum valuestepnumber1Step incrementdisabledbooleanfalseDisables the sliderorientation"horizontal" | "vertical""horizontal"Layout orientation