shadcn.io is not affiliated with official shadcn/ui
Field examples · Advanced
Range Slider Field for React
A two-thumb price range slider whose description shows the live range.
A minimum and a maximum on one track, for price filters and other bounded ranges. The Slider has two thumbs from a two-number value, and the FieldDescription prints both ends as they move, with tabular-nums so the digits don't shift.
Preview
Installation
FAQ
Why does the price slider use an array?
value starts as 200 and 800. Two numbers draw two thumbs, the low end and the high end of the range.
What are the limits and the step?
The range is 0 to 1000 and step is 10. The bounds are min and max. Each move snaps to that step.
How does the sentence show both prices?
FieldDescription prints both numbers from value, inside Set your budget range. font-medium and tabular-nums on each number keep the digits aligned as they change.
Update value from onValueChange.
What names the slider?
FieldTitle is the visible caption, Price Range. aria-label on Slider names the control, because FieldTitle is a visual title.
Related
- Simple Slider FieldA volume slider whose description shows
- Right Drawer Filter PanelA right drawer of product filters
- Dropdown with Checkboxes Dropdown MenuA View menu of checkbox rows that show or
- Complex Multi-Field FormA personal information fieldset with
- Choice Cards FieldRadio choice cards, each a bordered row
- Fieldset with LegendAn address fieldset with a legend, a