Slider

An easily stylable range input.

API reference

Import the component and place its parts the following way:

Anatomy
import { Slider } from '@base-ui-components/react/slider';

<Slider.Root>
  <Slider.Output />
  <Slider.Control>
    <Slider.Track>
      <Slider.Indicator />
      <Slider.Thumb />
    </Slider.Track>
  </Slider.Control>
</Slider.Root>

Root

PropTypeDefault
aria-labelledbystringundefined
classNamestring | (state) => stringundefined
defaultValueArray<number> | numberundefined
disabledbooleanfalse
largeStepnumber10
maxnumber100
minnumber0
minStepsBetweenValuesnumber0
namestringundefined
onValueChange(value, event, activeThumbIndex) => voidundefined
onValueCommitted(value, event) => voidundefined
orientation'horizontal' | 'vertical''horizontal'
render| React.ReactElement
| (props, state) => React.ReactElement
undefined
stepnumber1
valueArray<number> | numberundefined

Output

PropTypeDefault
classNamestring | (state) => stringundefined
render| React.ReactElement
| (props, state) => React.ReactElement
undefined

Control

PropTypeDefault
classNamestring | (state) => stringundefined
render| React.ReactElement
| (props, state) => React.ReactElement
undefined

Track

PropTypeDefault
classNamestring | (state) => stringundefined
render| React.ReactElement
| (props, state) => React.ReactElement
undefined

Indicator

PropTypeDefault
classNamestring | (state) => stringundefined
render| React.ReactElement
| (props, state) => React.ReactElement
undefined

Thumb

PropTypeDefault
aria-labelstringundefined
aria-valuetextstringundefined
classNamestring | (state) => stringundefined
getAriaLabelfunction(index: number) => stringundefined
getAriaValueTextfunction(value: number, index: number) => stringundefined
render| React.ReactElement
| (props, state) => React.ReactElement
undefined