Skip to content

Slider API

API reference docs for the React Slider component. Learn about the props, CSS, and other APIs of this exported module.

Demos

For examples and details on the usage of this React component, visit the component demo pages:

Import

import Slider from '@mui/material/Slider';
// or
import { Slider } from '@mui/material';
Learn about the difference by reading this guide on minimizing bundle size.

Props

Props of the native component are also available.

aria-label

aria-labelledby

aria-valuetext

classes

color

components

componentsProps

defaultValue

disabled

disableSwap

getAriaLabel

getAriaValueText

marks

max

min

name

onChange

onChangeCommitted

orientation

scale

size

slotProps

slots

step

sx

tabIndex

track

value

valueLabelDisplay

valueLabelFormat

The ref is forwarded to the root element.

Theme default props

You can use MuiSlider to change the default props of this component with the theme.


CSS

The following class names are useful for styling with CSS (the state classes are marked).
To learn more, visit the component customization page.

.MuiSlider-root

.MuiSlider-colorPrimary

.MuiSlider-colorSecondary

.MuiSlider-colorError

.MuiSlider-colorInfo

.MuiSlider-colorSuccess

.MuiSlider-colorWarning

.MuiSlider-marked

.MuiSlider-vertical

.Mui-disabledSTATE

.MuiSlider-dragging

.MuiSlider-rail

.MuiSlider-track

.MuiSlider-trackFalse

.MuiSlider-trackInverted

.MuiSlider-thumb

.Mui-activeSTATE

.Mui-focusVisibleSTATE

.MuiSlider-mark

.MuiSlider-markActive

.MuiSlider-markLabel

.MuiSlider-markLabelActive

.MuiSlider-sizeSmall

.MuiSlider-thumbColorPrimary

.MuiSlider-thumbColorSecondary

.MuiSlider-thumbColorError

.MuiSlider-thumbColorInfo

.MuiSlider-thumbColorSuccess

.MuiSlider-thumbColorWarning

.MuiSlider-thumbSizeSmall

.MuiSlider-valueLabel

.MuiSlider-valueLabelOpen

.MuiSlider-valueLabelCircle

.MuiSlider-valueLabelLabel


You can override the style of the component using one of these customization options: