product | title | githubLabel | unstyled |
---|---|---|---|
joy-ui |
React Slider component |
component: slider |
/base/react-slider/ |
Slider generates a background element that can be used for various purposes.
{{"component": "modules/components/ComponentLinkHeader.js"}}
{{"demo": "SliderUsage.js", "hideToolbar": true}}
By passing a number to the step
prop, you can change the default step increment.
{{"demo": "StepsSlider.js"}}
By providing an array of objects to the marks
prop, you can have custom marks.
{{"demo": "MarksSlider.js"}}
You can force the thumb label to be always visible with valueLabelDisplay="on"
.
{{"demo": "AlwaysVisibleLabelSlider.js"}}
For horizontal slider on mobile viewports, the value label might be offset from the track. Apply the style to keep the label at the start/end edges:
{{"demo": "EdgeLabelSlider.js"}}
By passing an array of values to the value
prop, you can use the Slider
to set the start and end of a range.
{{"demo": "RangeSlider.js"}}
The track shows the range available for user selection.
The track can be turned off with track={false}
.
{{"demo": "TrackFalseSlider.js"}}
The track can be inverted with track="inverted"
.
{{"demo": "TrackInvertedSlider.js"}}
{{"demo": "SliderVariables.js", "hideToolbar": true}}