How to build an accessible Slider in React

Renders a native <input type="range"> so the slider role, value announcements, and full arrow/Home/End keyboard support come from the platform without custom ARIA.

When to use a Slider

When not to use it

Keyboard interactions

Role slider, verified at WCAG 2.2-AA.

Common mistakes

Avoid: <Slider label="Price" min={0} max={1000000} />

Prefer: <NumberInput label="Price" />

A huge range makes a single value impossible to hit by dragging; type the exact number instead

Example

<Slider label="Volume" defaultValue={50} />

See the full Slider reference →