shadcn.io is not affiliated with official shadcn/ui
Slider examples · Styled
Large/Thick Slider for React
A Volume slider with a thicker track and a larger thumb.
Framework
UI library
A bigger target for touch and for people who need it. The track is 12px thick and the thumb 24px across. Use it on touch screens or wherever precision is hard.
Preview
Installation
Sign in to get your install command
Free with an account. It carries your token, so the CLI installs everything in one go.
FAQ
How are the track and thumb enlarged?
The slider's class sets h-3 on the part with data-slot="slider-track" and size-6 on the part with data-slot="slider-thumb".
How does the readout follow the thumb?
The value lives in state, starting at 55, and goes back to the slider as value. The percentage beside the label prints it.
onValueChange receives the new value, and the handler stores it as an array.
Does this work for a vertical slider?
The h-3 only thickens a horizontal track. A vertical one needs w-3 on the track instead.
Related
- Minimal Style SliderAn Intensity slider drawn as an outlined
- Simple SliderA single-thumb slider with no label or
- Colored SliderA Success Rate slider whose fill and
- With Tooltip SliderA Progress slider with a bubble above the
- Button with Text (Standard)The one filled action
- With Increment/Decrement Buttons SliderA Quantity slider between minus and plus