Skip to content

Slider

Sliders allow users to make selections from a range of values.

Sliders reflect a range of values along a bar, from which users may select a single value. They are ideal for adjusting settings such as volume, brightness, or applying image filters.

  • 📦 22 kB gzipped (but only 8 kB without @material-ui/styles).

Continuous sliders

Continuous sliders allow users to select a value along a subjective range.

Volume

Discrete sliders

Discrete sliders can be adjusted to a specific value by referencing its value indicator. By order of demos:

  1. You can generate a mark for each step with marks={true}.
  2. You can have custom marks by providing a rich array to the marks prop.
  3. You can restrict the selectable values to those provided with the marks prop with step={null}.
  4. You can force the thumb label to be always visible with valueLabelDisplay="on".

Temperature

30

Small Steps

5e-8

Custom marks

0°C20°C37°C100°C20

Restricted values

0°C20°C37°C100°C2

Always visible

0°C20°C37°C100°C80

Range sliders

Temperature range

2037

Customized sliders

Here are some examples of customizing the component. You can learn more about this in the overrides documentation page.

iOS

60

pretto.fr

20

Tooltip value label

Airbnb

With input field

Volume

Vertical sliders

Temperature

0°C20°C37°C100°C

Accessibility

The component handles most of the work necessary to make it accessible. However, you need to make sure that:

  • The slider, as a whole, has a label (aria-label or aria-labelledby prop).
  • Each thumb has a user-friendly name for its current value. This is not required if the value matches the semantics of the label. You can change the name with the getAriaValueText or aria-valuetext prop.