shadcn.io is not affiliated with official shadcn/ui
Slider examples · Range
Price Range Slider for React
A two-thumb price slider from $0 to $1000 with the selected prices shown under the track.
Framework
UI library
A price filter needs both a floor and a ceiling. Two thumbs run from $0 to $1000, and the two prices under the track update as they move. Use it in a product filter beside other facets.
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 does the readout follow the thumb?
The value lives in state, starting at [200, 800], and goes back to the slider as value. The two prices under the track print value[0] and value[1] with a dollar sign.
onValueChange receives the new value, and the handler stores it as an array.
How are the thumbs named?
Price Range is a visible Label.
On Base UI, aria-label names the slider Price range.
Related
- Basic Range SliderA two-thumb slider for picking a range
- Range with Value Display SliderA two-thumb slider with the selected
- Range with Constraints SliderA two-thumb slider whose thumbs always
- Percentage Range SliderA two-thumb percentage slider that steps
- Input with LabelA text input with a label above it
- Simple Single Select ComboboxA single-select combobox that opens from