[?] Component size, gzipped: 32kb
Slider
Props
Style Overrides
Theme
Beta
Control input with sliding axis to choose a single value or range between min and max values.
There are two slider options in Base that allow users to select a single value or a range. Each slider has a primary control handle that cues user interaction.
Accessibility
Slider sets these attributes:
role="slider"aria-valueminaria-valuemaxaria-valuenow
Thumbs can be focused and controlled by the keyboard:
tabandshift+tabto focus thumbsarrow uporarrow rightorkto increase the thumb value by one steparrow downorarrow leftorjto decrease the thumb value by one steppage upto increase the thumb value by ten stepspage downto decrease the thumb value by ten steps
The component is also optimized for iOS and Android devices.
Examples
As with many of our components, there is also an uncontrolled version, StatefulSlider, which manages its own state.
API
Slider exports
You can import this module like so:
import {Slider} from 'baseui/slider'
It exports the following components or utility functions:
- Slider
- StatefulSlider
- StatefulContainer
- StyledRoot
- StyledTrack
- StyledInnerTrack
- StyledThumb
- StyledInnerThumb
- StyledTick
- StyledTickBar
- StyledThumbValue