Slider

Picks a value or range by dragging.

@paneui/theme@paneui/control-size@base-ui/react
Creativity
Reasoning effort
Price range

Installation

pnpm dlx shadcn@latest add @paneui/slider

Usage

Examples

Controlled

Use when the value is shown or used elsewhere.

Vertical

Use in tall, narrow spaces such as a mixer column.

Tick Count

Use when the steps matter, such as a rating.

Disabled

Sizes

RTL

Motion

With reduced motion the thumb and value bubble don't animate.

Keyboard

Arrow keys move the focused thumb by step; Page Up / Page Down and Home / End jump further.

For a single value with the label on the track, see Range Slider Inline.

API Reference

Built on the Slider primitive. Only the props this library adds or changes are listed; everything else passes through.

Slider

Inset track, primary fill and a raised thumb. Pass an array value for a range. Also accepts every prop of Slider.Root.

size= "default"
"sm" | "default" | "lg"
Thumb 16 / 20 / 24px on a 6 / 8 / 10px track. Inside a sized Field it takes the field's size (xs maps to sm).
ticks
boolean | number
Dots along the track. true draws one per step; a number (2–101) draws that many, evenly spaced.
showValue
boolean | "always"
true shows a value bubble over each thumb on hover, focus and drag; "always" keeps it up.
getThumbLabel
(index: number) => string
Accessible label per thumb, e.g. (i) => (i ? "Max" : "Min") for a range.
min= 0
number
Lowest value.
max= 100
number
Highest value.
step= 1
number
Step between values.
orientation= "horizontal"
"horizontal" | "vertical"
Layout direction. Vertical fills the parent's height, at least 160px.
thumbAlignment= "edge"
"edge" | "center"
edge keeps the thumb inside the track at both ends (the primitive defaults to center).
format
Intl.NumberFormatOptions
Formats the value bubble, e.g. currency.
PropTypeDefaultDescription
size"sm" | "default" | "lg""default"Thumb 16 / 20 / 24px on a 6 / 8 / 10px track. Inside a sized Field it takes the field's size (xs maps to sm).
ticksboolean | number—Dots along the track. true draws one per step; a number (2–101) draws that many, evenly spaced.
showValueboolean | "always"—true shows a value bubble over each thumb on hover, focus and drag; "always" keeps it up.
getThumbLabel(index: number) => string—Accessible label per thumb, e.g. (i) => (i ? "Max" : "Min") for a range.
minnumber0Lowest value.
maxnumber100Highest value.
stepnumber1Step between values.
orientation"horizontal" | "vertical""horizontal"Layout direction. Vertical fills the parent's height, at least 160px.
thumbAlignment"edge" | "center""edge"edge keeps the thumb inside the track at both ends (the primitive defaults to center).
formatIntl.NumberFormatOptions—Formats the value bubble, e.g. currency.
data-size
On the root, the resolved size.
data-dragging
On the thumb while it is dragged (scaled up).
data-active
On a tick (data-slot="slider-tick") inside the selected range.
data-disabled
Present when disabled.
Data attributeDescription
data-sizeOn the root, the resolved size.
data-draggingOn the thumb while it is dragged (scaled up).
data-activeOn a tick (data-slot="slider-tick") inside the selected range.
data-disabledPresent when disabled.