Get Started
Components
- Accordion
- Alert
- Alert Dialog
- Aspect Ratio
- Attachment
- Avatar
- Badge
- Breadcrumb
- Bubble
- Button
- Button Group
- Calendar
- Card
- Carousel
- Chart
- Checkbox
- Collapsible
- Combobox
- Command
- Confirm Dialog
- Container
- Context Menu
- Dialog
- Direction
- Drawer
- Dropdown Menu
- Empty
- Field
- Hover Card
- Input
- Input Group
- Input Number
- Input OTP
- Item
- Kbd
- Label
- Marker
- Menubar
- Message
- Message Scroller
- Native Select
- Navigation Menu
- Pagination
- Popover
- Progress
- Radio Group
- Resizable
- Scroll Area
- Select
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Sonner
- Spinner
- Switch
- Table
- Tabs
- Tailwind Indicator
- Textarea
- Toggle
- Toggle Group
- Tooltip
import { Slider } from "@/components/ui/slider"
export function SliderDemo() {
return (
<SliderInstallation
pnpm slabui add slider
Usage
import { Slider } from "@/components/ui/slider"<Slider defaultValue={[33]} max={100} step={1} />Range
Use an array with two values for a range slider.
import { Slider } from "@/components/ui/slider"
export function SliderRange() {
return (
<SliderMultiple Thumbs
Use an array with multiple values for multiple thumbs.
import { Slider } from "@/components/ui/slider"
export function SliderMultiple() {
return (
<SliderVertical
Use orientation="vertical" for a vertical slider.
import { Slider } from "@/components/ui/slider"
export function SliderVertical() {
return (
<div className="mx-auto flex w-full max-w-xs items-center justify-center gap-6">Controlled
0.3, 0.7
"use client"
import * as React from "react"
import { Label } from "@/components/ui/label"Disabled
Use the disabled prop to disable the slider.
import { Slider } from "@/components/ui/slider"
export function SliderDisabled() {
return (
<SliderAPI Reference
See the Base UI Slider documentation.