Slider
Input to select a value from a given range.
Best Practices
- Use a slider for ranged numeric input where shape and proximity matter more than precision: bandwidth caps, opacity, audio volume, color channels.
- For exact values like a port number or memory limit, pair the slider with a numeric Input; keyboard users default to typing.
- Snap to a sensible step (
1,5,10%) so dragging never produces values like47.83291. Clampminandmaxto real product limits. - Always render the live value next to the track in tabular nums, and label what the number represents (
Sample Rate · 44 kHz). The track alone is not self-describing. - Threshold colors (warning, error tints past a limit) should match the same numeric breakpoint surfaced elsewhere in the UI; don’t invent a slider-only threshold.
- Give the slider an accessible name through a sibling
<label htmlFor>oraria-label, and let the native arrow-key, Page Up/Down, Home/End behavior do the keyboard work. Don’t intercept those keys.
Was this helpful?