ReferenceSliders
VolumeSlider
A slider component for controlling media playback volume
Import
Anatomy
Behavior
Controls the media volume level. The slider maps its 0–100 internal range to the media’s 0–1 volume scale. When the media is muted, the fill level drops to 0 regardless of the stored volume value.
When volumeAvailability is not "available", the component returns null. This is independent of mutedAvailability, which controls whether the mute button is shown.
Styling
Use CSS custom properties to style the fill and pointer levels:
React renders a <div> element. Add a className to style it:
Accessibility
Renders with role="slider" and an automatic aria-label that resolves to “Volume” from the active locale. Override with the label prop. Keyboard controls:
- Arrow Left / Arrow Right: step by
stepincrement - Page Up / Page Down: step by
largeStepincrement - Home: set volume to 0
- End: set volume to max
Scroll wheel support:
- Mouse wheel / trackpad scroll: adjusts volume by
wheelStepincrement (default5)
Examples
Nest sub-components for full control over the slider’s DOM structure. This example includes a track, fill bar, draggable thumb, and a tooltip that shows the volume percentage on hover.
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.