VolumeSlider 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.
Sub-components
AllSlider.* sub-components are available inside VolumeSlider via the shared slider context.
| Component | Description |
|---|---|
VolumeSlider.Root | Root slider element. Manages volume state and keyboard controls. |
Requires the
volume feature to be registered with the player.Import
Basic Usage
VolumeSlider.Root Props
Override the default
aria-label of "Volume". Used by screen readers to identify the slider.Step size for arrow key navigation (0–100 scale). Defaults to
5.Large step size for
Page Up / Page Down key navigation. Defaults to 10.Slider orientation. Defaults to
"horizontal".Disables the slider.
Controls how the thumb aligns relative to the track at min/max positions.
Called when the user begins dragging the slider thumb.
Called when the user releases the slider thumb after dragging.
CSS class name or a function that receives state and returns a class name.
Inline style or a function that receives state and returns a style object.
Custom render prop for the root element.
State Data Attributes
| Attribute | Value / Description |
|---|---|
data-pointing | Present while the pointer is hovering over the slider. |
data-interactive | Present when the user is interacting (pointing or dragging). |
data-dragging | Present while the thumb is being dragged. |
data-orientation | "horizontal" | "vertical" — reflects the orientation prop. |
CSS Styling Example
Accessibility
Renders withrole="slider" and automatic aria-label of "Volume". Keyboard controls:
Arrow Left/Arrow Right: step bystepamountPage Up/Page Down: step bylargeStepamountHome: set volume to 0End: set volume to maximum