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/joy/Slider';
// or
import { Slider } from '@mui/joy';
Learn about the difference by reading this guide on minimizing bundle size.

Props

aria-label

aria-valuetext

classes

color

component

defaultValue

disabled

disableSwap

getAriaLabel

getAriaValueText

isRtl

marks

max

min

name

onChange

onChangeCommitted

orientation

scale

size

slotProps

slots

step

sx

tabIndex

track

value

valueLabelDisplay

valueLabelFormat

variant

The ref is forwarded to the root element.

Theme default props

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


Slots

To learn how to customize the slot, check out the Overriding component structure guide.

root

track

rail

thumb

mark

markLabel

valueLabel

input

CSS classes

These class names are useful for styling with CSS. They are applied to the root slot when specific states are triggered.

.Mui-disabledSTATE

.Mui-focusVisibleSTATE

.MuiSlider-colorContext

.MuiSlider-colorDanger

.MuiSlider-colorNeutral

.MuiSlider-colorPrimary

.MuiSlider-colorSuccess

.MuiSlider-colorWarning

.MuiSlider-dragging

.MuiSlider-markActive

.MuiSlider-marked

.MuiSlider-sizeLg

.MuiSlider-sizeMd

.MuiSlider-sizeSm

.MuiSlider-trackFalse

.MuiSlider-trackInverted

.MuiSlider-valueLabelOpen

.MuiSlider-variantOutlined

.MuiSlider-variantPlain

.MuiSlider-variantSoft

.MuiSlider-variantSolid

.MuiSlider-vertical