Skip to content

Slider

Form

Range input for selecting a numeric value within a min/max range. Supports single and dual thumbs.

Single thumbRangeDisabled
Open preview

Responsive viewport — resize the window to explore. Direction and density apply only to this preview. Theme applies to the docs too.

Usage

Pass an array containing one value for a single thumb or two values for a range. The default creates two thumbs; set defaultValue explicitly for a single-value slider.

Import
import { Slider } from "@dashboardpack/core/components/ui/slider";

Available in the included @dashboardpack/core package. Copy the complete example from Source code for all imports and state. Add "use client" when using hooks or event handlers. See installation and theming for project setup.

API reference

Common props and defaults. Slot-specific props are named below; native elements also accept their standard HTML attributes. The component TypeScript definitions are the complete type reference.

Slider props
PropType / DefaultDescription
value / defaultValuenumber[]

Default: [min, max]

Controlled or initial thumb positions.
onValueChange(values: number[]) => void

Default: —

Handle updates while dragging.
min / maxnumber

Default: 0 / 100

Allowed numeric bounds.
stepnumber

Default: 1

Step between values.
disabledboolean

Default: false

Disable changes.

Build with these too