Slider

Two variants: compact (spring-snapped thumb with track fill and range mode) and comfortable (pip-based discrete selector for settings panels).

Installation

npx shadcn@latest add https://www.fluidfunctionalism.com/r/slider.json

Compact

25

Range

2575

Steps

50
50

Value Display

Volume: 40
Volume: 60

Format

Opacity: 75%

Disabled

50

Comfortable

Roundness2

Comfortable — Scrubber

Volume
50%

Comfortable — Format

QualityMedium

Comfortable — Disabled

Roundness2

API Reference

Slider

PropTypeDefaultDescription
valuenumber | [number, number]Current value. Pass an array to enable range mode with two thumbs.
onChange(value: SliderValue) => voidCalled when the value changes via drag, click, or keyboard.
minnumber0Minimum value.
maxnumber100Maximum value.
stepnumber1Step increment. Thumb snaps to the nearest step during drag.
showStepsbooleanfalseRender dot indicators at each step position on the track.
showValuebooleantrueWhether to display the current value label.
valuePosition"left" | "right" | "top" | "bottom" | "tooltip""left"Position of the value label. "tooltip" shows above the thumb during interaction.
formatValue(v: number) => stringStringCustom formatter for the value label.
labelstringAccessible label for the slider, also shown as prefix in the value display.
disabledbooleanfalseDisables all interaction.

SliderComfortable

PropTypeDefaultDescription
valuenumberCurrent selected value.
onChange(value: number) => voidCalled when the value changes via click, drag, or keyboard.
minnumber0Minimum value.
maxnumber100Maximum value.
variant"pips" | "scrubber""pips"Visual mode. "pips" shows discrete dot indicators. "scrubber" shows no dots — drag anywhere in the row to set a continuous value.
stepnumber1Step increment for snapping. In pips mode, also determines the number of dots rendered.
labelstringLabel shown on the left side. Transitions from muted to foreground on hover.
formatValue(v: number) => stringStringCustom formatter for the value shown on the right.
disabledbooleanfalseDisables all interaction.