
- Location:
sabo/src/components/ui/slider.tsx
When to use
- Choose a value or range visually (volume, price range).
- Use inputs for exact values; Sliders are great for exploration.
Usage
sabo/src/components/ui/slider.tsx
Key props
Controlled values (single or range). Use
defaultValue for uncontrolled.Minimum value.
Maximum value.
This component forwards all props from Radix Slider primitives (Root/Thumb/Track, etc.). Above are commonly used props. For the full API, see Radix docs: https://www.radix-ui.com/primitives/docs/components/slider
Styling tip
- Adjust orientation via CSS classes; vertical sliders need a fixed height.
- Thicken the track with
data-[orientation=horizontal]:h-2.
Accessibility
- Provide a nearby label and current value when the context isn’t obvious.