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
Variants and sizes
- Default (
k-slider): one size; the input is 48px tall across its full width.
States
- Rest: fill and thumb at the value, the value in text above.
- Hover: the pointer turns into a hand.
- Dragging: the value text changes with every step.
- Focus: a 2px
focus-ringring 2px outside the slider's 48px row. - Disabled: avoid it; when a value is fixed, show it as text with the reason.
Do and don’t
Do
Show the value with its unit, in mono: "25 min".
Use steps people think in, like 5 min.
Update
--k-fill, the value text andaria-valuetexton everyinputevent.
Don’t
Hide the value until the person drags.
Use a slider for money or any number that must be exact.
What you provide
- Label,
min,max,stepand the value. - The unit, for the value text and
aria-valuetext. - What happens on change.