- Accordion
- Action BarUpdated
- Alert Dialog
- Alert
- Announcement
- Aspect Ratio
- Autocomplete
- Avatar
- BadgeUpdated
- Bottom Navigation
- Breadcrumb
- Button Group
- Button
- CalendarUpdated
- CardUpdated
- Carousel
- Chart
- Checkbox
- Circular Progress
- Circular Slider
- Clipboard
- Collapsible
- Color Picker
- Combobox
- Command
- Context MenuUpdated
- Data List
- Date Picker
- DialogUpdated
- DrawerUpdated
- Editable
- FieldUpdated
- File Upload
- Float
- Floating Panel
- Frame
- Hint
- Hover Card
- Image Cropper
- Input Group
- Input OTP
- Input
- Item
- Kbd
- Link Overlay
- Listbox
- MarqueeUpdated
- Menu
- Native Select
- Number InputUpdated
- Pagination
- Popover
- Progress
- Prose
- QR Code
- Radio Group
- Rating
- Resizable
- Scroll Area
- Segment Group
- Select
- Separator
- Sheet
- Sidebar
- Signature Pad
- Skeleton
- Skip Nav
- Slider
- Spinner
- Status
- Steps
- Switch
- TableUpdated
- Tabs
- Textarea
- TimerUpdated
- ToastUpdated
- Toggle Group
- Toggle Tooltip
- Toggle
- Tooltip
- Tour
- Tree View
Installation#
pnpm dlx shadcn@latest add @shark/slider
Usage#
import { Slider } from "@/components/ui/slider";
<Slider />
Controlled#
Control the value with value and onValueChange for a controlled slider.
Greater than 80
❌
Examples#
With label and value#
Use <Field>, <SliderLabel>, and <SliderValue> for accessible labelling and to show the current value.
Range#
Use an array with two values for a range slider.
Vertical#
Use orientation="vertical" for a vertical slider.
Disabled#
Use the disabled prop to disable the slider.
Min and max#
Set min and max to constrain the slider's value range.
Marks#
The showMarkers and markerInterval props display markers and control the interval between them.
Step#
Set step to control the slider's granularity.
Use with showMarkers and markerLabels to show custom labels on the markers.
Marks are only supported for horizontal sliders.
API Reference#
Slider#
Root component. Manages value, track, range, and thumb(s).
| Prop | Type | Default |
|---|---|---|
value | number[] | - |
defaultValue | number[] | - |
onValueChange | (details: ValueChangeDetails) => void | - |
min | number | 0 |
max | number | 100 |
step | number | 1 |
orientation | "horizontal" | "vertical" | "horizontal" |
disabled | boolean | false |
showMarkers | boolean | false |
markerInterval | number | 1 |
markerLabels | string[] | [] |
className | string | - |
SliderLabel#
Label for the slider. Required for accessibility.
| Prop | Type | Default |
|---|---|---|
className | string | - |
SliderValue#
Shows the current value. Useful for numeric display or formatting.
| Prop | Type | Default |
|---|---|---|
className | string | - |
For a complete list of props, see the Ark UI documentation.