Selection
Slider
A slider sets a number in a known range by dragging, tapping or the arrow keys, such as the length of a session, and always shows the value in text.
In kanso-ui as Slider
Accessibility
- Role and name: a native
<input type="range">withmin,maxandstep, named by its<label for>.aria-valuetext("25 minutes") makes screen readers say the unit, not just "25". - Keyboard: the arrow keys move one step (5 min); Home and End jump to 5 and 60 min.
- The value is always in text, so nobody has to judge the thumb's place or the fill's colour to know it, and it matches what a screen reader says.
- Dragging is never the only way: a tap on the track moves the thumb there (WCAG 2.2, 2.5.7 Dragging Movements), and the keys step it.
- Targets: the whole 48px row takes taps and drags, not only the 24px thumb.
- Contrast (light, dark): thumb
inkonpaper16.7 and 15.9:1; fillaccentonpaper7.3 and 9.0:1; valueinkonpaper16.7 and 15.9:1; labelink-mutedonpaper6.4 and 8.9:1; focus ring 7.3 and 9.0:1. The emptycontainertrack is only a guide; the thumb and the value text carry the state. - Motion: none of its own; the thumb follows the pointer.