Slider

Sliders let people make selections from a range of values.

Usage

Slider lets people select a numeric value from a range along a track by dragging the handle, clicking the track, or using the keyboard. Use defaultValue for uncontrolled usage; the component owns its value from then on and only notifies changes.

30

Value: 30

Controlled usage

Use value with onChange in React, [(value)] in Angular, or bind:value in Svelte. A controlled Slider requests a transition but does not change until its owner supplies the new value. Choose one mode (controlled or uncontrolled) for the component’s lifetime.

50

Value: 50

Marks

Provide marks to snap to labeled positions instead of a fixed increment; omitting step alongside marks uses the marks as the only valid stops. When both are provided, step wins and marks are shown for reference only. With neither, the slider defaults to a step of 10.

50

Open-ended range

min/max accept -Infinity/Infinity for an open-ended range. Pair the open end with a matching marks entry (also -Infinity/Infinity) so it has a label and a reachable position; the nearest finite marks resolve the interpolation range under the hood.

0

Disabled

disabled prevents interaction, removes the slider from the tab order, and excludes its value from form submission.

40

Accessibility

The track renders role="slider" with aria-valuemin/aria-valuemax (omitted on an open end) and aria-valuenow/aria-valuetext. It is focusable and responds to ArrowLeft/ArrowRight/ArrowUp/ArrowDown (one step, or one mark when using marks without step) and Home/End (jump to the bounds). disabled sets aria-disabled and removes it from the tab order. Provide aria-label or aria-labelledby; this component does not render label text.