shadcn.io is not affiliated with official shadcn/ui
Slider examples · Standard
Slider with Min/Max Labels for React
A Size slider with its minimum and maximum written under each end of the track.
Numbers under the ends tell people the scale before they drag. 0 sits under the start and 100 under the end, in small muted text. Use it when the range is not obvious from the label.
Preview
Installation
FAQ
How are the end labels placed?
A flex items-center justify-between row under the slider, with 0 and 100 in text-xs muted text. They are plain text, so they don't change with min and max.
What range does it cover?
0 to 100. Keep the labels in step with the slider's range when you change it.
min and max set the ends.
How is the slider named?
The Size text is a visible Label, and the slider gets the same name with aria-label, so screen readers announce what it sets.
On Base UI, aria-label is one string on the slider.
Related
- Slider with LabelA slider with a Volume label above the
- Slider with Value DisplayA Quality slider with its percentage
- Slider with Step IndicatorsA Level slider that snaps in steps of 25
- Temperature Control SliderA Temperature slider from 16°C to 30°C on
- Percentage Range SliderA two-thumb percentage slider that steps
- Input with LabelA text input with a label above it