On this page
Props
orientation
<Slider defaultValue={50}>
<Label>Volume</Label>
<SliderControl />
</Slider>Installation
npm
pnpm
yarn
bun
npx shadcn@latest add @dotui/sliderUsage
Use slider to allow users to select a value from within a given range.
import { Slider, SliderControl } from '@/components/ui/slider'<Slider defaultValue={50}>
<SliderControl />
</Slider>Examples
API Reference
Slider
A slider allows a user to select one or more values within a range.
| Prop | Type | Default | |
|---|---|---|---|
ReactNode | function | — | ||
boolean | — | ||
Orientation | 'horizontal' | ||
number | number[] | — | ||
number | number[] | — | ||
function | — | ||
function | — | ||
NumberFormatOptions | — | ||
SliderControl
A slider control is the interactive surface that positions the track and thumbs.
| Prop | Type | Default | |
|---|---|---|---|
ReactNode | function | — | ||
SliderTrack
A slider track is the visual track that contains the selected fill.
Supports all div attributes.
| Prop | Type | Default | |
|---|---|---|---|
SliderFill
A slider fill displays the selected region of the track.
| Prop | Type | Default | |
|---|---|---|---|
ReactNode | function | — | ||
SliderThumb
A slider thumb represents an individual value that the user can adjust within a slider track.
| Prop | Type | Default | |
|---|---|---|---|
ReactNode | function | — | ||
number | 0 | ||
RefObject<HTMLInputElement | null> | — | ||
boolean | — | ||
Orientation | 'horizontal' | ||
SliderOutput
A slider output displays the current value of a slider as text.
| Prop | Type | Default | |
|---|---|---|---|
ReactNode | function | — | ||
Last updated on 6/16/2026