Slider

Continuous or stepped range input for numeric values. Supports single or multi-thumb selection.

Default

Single thumb, 0-100.

Dark previewReplay previewOpen in new tab

Usage

Import the parts you need from the component's folder.

ts
import { Slider } from "@/components/ui/slider";

Controlled

Bound to a ref with the value shown as text and a reset button.

Dark previewReplay previewOpen in new tab
40%

Range

Two thumbs for selecting a range.

Dark previewReplay previewOpen in new tab

Two-thumb range

Two-thumb range from an array model value, with tooltips and a live output.

Dark previewReplay previewOpen in new tab
25 – 75

Stepped

Snap to discrete step values.

Dark previewReplay previewOpen in new tab

Wide thumb

Pill-shaped handle wider than it is tall, suited to open/close style controls.

Dark previewReplay previewOpen in new tab
OPENCLOSE

Ruler scrubber

Recessed tick-ruler with a thin glowing indicator and a paired number input, matching design-tool property panels.

Dark previewReplay previewOpen in new tab
Offset X
Offset Y
Rotation
Scale

Simple

Basic slider with a label.

Dark previewReplay previewOpen in new tab

Disabled

Non-interactive, dimmed state.

Dark previewReplay previewOpen in new tab

Square thumb

Thumb with squared-off corners.

Dark previewReplay previewOpen in new tab

Solid thumb

Filled thumb over a faded track.

Dark previewReplay previewOpen in new tab

Tiny thumb

Slim bar-style thumb.

Dark previewReplay previewOpen in new tab

Reference labels

Static reference labels beneath the track.

Dark previewReplay previewOpen in new tab

Ticks

Tick marks with skipped value labels.

Dark previewReplay previewOpen in new tab

With output

Live value shown beside the label.

Dark previewReplay previewOpen in new tab
25

With labels

Descriptive labels above the track.

Dark previewReplay previewOpen in new tab

Labels and tooltip

Labels plus a value tooltip on the thumb.

Dark previewReplay previewOpen in new tab

Dual range

Two thumbs selecting a min and max.

Dark previewReplay previewOpen in new tab

Dual range with output

Range with a live min-max output.

Dark previewReplay previewOpen in new tab
25 - 75

Volume

Volume control flanked by icons.

Dark previewReplay previewOpen in new tab
25

Multiple thumbs

Three thumbs with formatted tooltips.

Dark previewReplay previewOpen in new tab

Temperature

Slider synced with an input and a reset action.

Dark previewReplay previewOpen in new tab

With input

Slider synced with a number input.

Dark previewReplay previewOpen in new tab

Rating with emoji

1-5 rating flanked by emoji.

Dark previewReplay previewOpen in new tab
Okay
😡😍

Rating with tooltip

Rating with a label tooltip and reactive emoji.

Dark previewReplay previewOpen in new tab
😐

Dual range with input

Range bounded by two inputs.

Dark previewReplay previewOpen in new tab

Plus / minus buttons

Stepper buttons alongside the slider.

Dark previewReplay previewOpen in new tab

Price range

Formatted price range with an action button.

Dark previewReplay previewOpen in new tab

Vertical

Vertical orientation.

Dark previewReplay previewOpen in new tab

Vertical with input

Vertical slider synced with an input.

Dark previewReplay previewOpen in new tab

Vertical dual range and tooltip

Vertical range with value tooltips.

Dark previewReplay previewOpen in new tab

Object position

Multiple labelled sliders with a reset-all action.

Dark previewReplay previewOpen in new tab
Object position

Price with histogram

Range slider over a price-distribution histogram.

Dark previewReplay previewOpen in new tab
$
$

Equalizer

Five vertical bands with pill thumbs and tooltips.

Dark previewReplay previewOpen in new tab
Equalizer

API Reference

Slider

PropTypeDefaultDescription
modelValuenumber[][0]Array of thumb values. Supports v-model.
minnumber0Min value.
maxnumber100Max value.
stepnumber1Increment between values.
disabledbooleanfalseDisable input.
orientation"horizontal" | "vertical""horizontal"Layout direction of the track.
showTooltipbooleanfalseShow a tooltip with the current value above each thumb.
tooltipContent(value: number) => stringundefinedFormatter for the tooltip label. Defaults to the raw value.
EventDescription
update:modelValueFires continuously as a thumb moves. Enables v-model.
value-commitFires once when the user releases a thumb.

Accessibility

Keyboard shortcuts and ARIA behavior.

Shortcut Description
←Decreases the value by one step.
↓Decreases the value by one step.
→Increases the value by one step.
↑Increases the value by one step.
HomeSets the value to the minimum.
EndSets the value to the maximum.
Page UpIncreases the value by a large step.
Page DownDecreases the value by a large step.
  • Each thumb has role=slider with aria-valuemin, aria-valuemax, and aria-valuenow.
  • Provide an accessible label so screen readers announce the slider's purpose.