Skip to content

Slider

Expressive

Chooses a value or a range on a continuous or stepped scale, in five sizes.

import { Slider, RangeSlider } from '@windmorph/react';

Keyboard

Slider keyboard
KeyAction
TabMoves focus to the thumb, and on to the next element. A range slider has two thumbs, each its own Tab stop.
Arrow Right or Arrow UpIncreases the value by step.
Arrow Left or Arrow DownDecreases the value by step.
Page Up or Page DownIncreases or decreases the value by a larger interval, a tenth of the range by default.
Shift + Arrow Right or Space + Arrow RightHolding Shift or Space while pressing any arrow key moves by the larger interval too.
Home or EndMoves the thumb to the minimum or the maximum.
  • In a right-to-left layout Arrow Left and Arrow Right swap, so the arrow always points the way the thumb moves.
  • The thumbs of a range slider can't pass each other.

Screen reader

Role
group around one slider per thumb: each thumb is a visually hidden native range input (React Aria useSlider / useSliderThumb).
Accessible name
aria-label, or aria-labelledby pointing at a visible label; the types require one. Each thumb is named as the group is: with aria-labelledby it points at the label itself, so it's read as the label, never as its value. A range slider puts each thumb's own name from labels (default "Minimum" and "Maximum") before the slider's: "Minimum Price". aria-describedby, aria-details and aria-errormessage reach every thumb, so helper or error text is read as each one takes focus.
States announced
The value, minimum and maximum, the orientation (aria-orientation), and disabled. The announced value (aria-valuetext) is formatted with formatOptions, or said in words by valueText, which gets each thumb's value and index (a time: "1 minute 25 seconds of 10 minutes").

The track, stop indicators, ticks, inset icons and the value indicator pill are decorative and hidden from assistive tech (aria-hidden).

Focus

  • Each thumb is in the Tab order. A disabled slider can't be focused.
  • Keyboard focus shows M3's focus indicator around the handle: a 3px secondary outline 2px outside it, with the gap to the track widened from 6px to 10px to make room. The handle narrows from 4px to 2px, as it does while dragged.
  • With valueLabel, the value indicator shows while a thumb is dragged or has keyboard focus. Pointer presses show no ring.

Touch target

  • Pressing anywhere on the track moves the nearest thumb there, so the hit area is the full length of the track.
  • It is as tall as the handle: 44px for XS and S, and 52, 68 and 108px for M, L and XL. An XS or S slider takes presses 2px past its edges on each side, so its hit area is 48px tall without changing its layout; leave 2px clear above and below it.

Motion

None. The slider has no animation: the thumb and tracks follow the value directly, so reduced motion changes nothing.

What you need to do

  • Name every slider with aria-label, or aria-labelledby pointing at a visible label.
  • Link helper or error text shown beside the slider with aria-describedby.
  • For a range slider, pass labels when "Minimum" and "Maximum" don't fit, or to translate them.
  • Pass formatOptions when the number alone is unclear (a percentage, a currency), so the value is announced with its unit.
  • When the exact value matters, show it (valueLabel, or a text field beside the slider) rather than relying on the track position.