ReferenceSliders
Slider
A composable slider component with track, fill, thumb, preview, and value parts
Import
Anatomy
Behavior
The base slider provides a generic range input. It manages value, pointer tracking, and drag interactions. The time slider and volume slider add media-specific bindings. The time slider also provides parts for rendering chapter ranges and the chapter at the current interaction position.
Slider.Thumbnail.Root supplies the pointer value to the thumbnail. Render Slider.Thumbnail.Image inside it for the controlled image; other children can provide loading indicators or overlays.
The slider supports vertical orientation via the orientation prop (defaults to "horizontal").
Styling
Use CSS custom properties to position fill, thumb, and preview elements:
React renders standard DOM elements. Add a className to style them:
Style based on interaction state:
Accessibility
Renders with role="slider" and automatic ARIA attributes (aria-valuemin, aria-valuemax, aria-valuenow, aria-valuetext). Override the label with the label prop. Keyboard controls:
- Arrow Left / Arrow Right: step by
stepincrement - Page Up / Page Down: step by
largeStepincrement - Home: jump to minimum
- End: jump to maximum
Examples
Basic
A slider with track, fill, and thumb.
With Preview
A slider with a pointer-tracking preview that displays the value at the current pointer position.
API Reference
Root
Props
State
render, className, and style props.
Data attributes
CSS custom properties
Preview
Positioning container for preview content that tracks the pointer along the slider.
Props
Data attributes
Thumb
Draggable handle for setting the slider value. Receives focus and handles keyboard interaction.
Props
Data attributes
Value
Displays a formatted text representation of the slider value. Renders an <output> element.