Range slider
Last updated: 2.0.0 (18/01/2024)
The Range slider is an expansion of the single-handle Slider component. This component can simultaneously support a virtually limitless number of handles.
Usage
The number of values handled (and therefore handles displayed) is determined by the number of initial values passed to the
useState
.
Minimum distance & pearling
You can stop one thumb from pushing its peers when they collide by using the pearling
prop. Additionally, the minDistance
prop controls the minimum distance that two thumbs can become. If pearling=true
, the thumbs will begin pushing one another around once they reach the minDistance
from one another.
Other modifications
Other modifications can be made to the Range slider using the same props as the regular Slider.
Props
Extends GenericInputProps<number[]>
and SliderEventProps<number[]>
.
min
number
The minimum value of this input. 0
by default.
max
number
The maximum value of this input. 100
by default.
step
number
The step value of this input. 1
by default.
minDistance
number
The minimum distance between the two thumbs. 0
by default.
pearling
boolean
Whether the active thumb will push other thumbs. true
by default.
showValue
boolean
Whether to show this slider's value on the thumb. false
by default.
invert
boolean
Whether to invert the direction of the slider. false
by default.
includeManualInput
boolean
Whether to include a manual input with this slider. true
by default.
manualInputPosition
"left" | "right"
The position of this manual input, if shown. "right"
by default.
trackProps
Optional props to pass to track components.
thumbProps
Optional props to pass to thumb components.
Last updated
Was this helpful?