TimeSlider is a compound slider component that displays and controls the current playback position. Dragging the thumb seeks the media. The fill level reflects currentTime / duration as a percentage, and the buffer indicator shows how much media has been buffered.
Sub-components
AllSlider.* sub-components are available inside TimeSlider via the shared slider context.
| Component | Description |
|---|---|
TimeSlider.Root | Root slider element. Manages seek state and keyboard controls. |
Slider.Track, Slider.Fill, Slider.Thumb, Slider.Buffer, Slider.Preview, and Slider.Value inside TimeSlider.Root for full DOM control.
Requires the
time feature to be registered with the player.Import
Basic Usage
TimeSlider.Root Props
Override the default
aria-label of "Seek". Used by screen readers to identify the slider.Step size in seconds for arrow key navigation. Defaults to
5.Large step size in seconds for
Page Up / Page Down key navigation. Defaults to 10.Throttle duration in milliseconds for seek commits during drag. Defaults to
100.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-seeking | Present while the user is actively seeking via drag. |
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 "Seek". Keyboard controls:
Arrow Left/Arrow Right: step bystepsecondsPage Up/Page Down: step bylargeStepsecondsHome: seek to startEnd: seek to end