Skip to main content

Slider

Select values by dragging a handle, built on Base UI.

View as Markdown

Installation

Component API

PropTypeDefaultDescription
labelstring-Text beside the value, above the track.
Text beside the value, above the track.
descriptionstring-A line under the control, for context on what the value means.
A line under the control, for context on what the value means.
defaultValuenumber | number[]-
valuenumber | number[]-Controlled value, same shape rule as defaultValue.
Controlled value, same shape rule as defaultValue.
onValueChange(value: number | number[]) => void-
minnumber0Lower bound.
Lower bound.
maxnumber100Upper bound.
Upper bound.
stepnumber1Amount each keyboard press or drag increment changes the value by.
Amount each keyboard press or drag increment changes the value by.
formatValue(value: number | number[]) => ReactNode-
unitstring-
marksstring[]-Labels spread evenly under the track, first at the start, last at the end.
Labels spread evenly under the track, first at the start, last at the end.
shapenone | rounded | pillrounded
disabledbooleanfalseBlocks interaction and dims the control.
Blocks interaction and dims the control.
requiredbooleanfalseAppends a red asterisk to the label.
Appends a red asterisk to the label.
classNamestring-
focusboolean | stringtrue