Time is a compound component for displaying formatted media time values. Three display types are supported: current, duration, and remaining.
Sub-components
| Component | Description |
|---|---|
Time.Group | Layout wrapper that synchronizes hour display across contained Time.Value elements. |
Time.Value | Renders a formatted time value as a <time> element. |
Time.Separator | Decorative separator between time values (e.g., /). aria-hidden by default. |
Time.Value requires the time feature to be registered with the player.Import
Basic Usage
Current Time
Current / Duration
Remaining Time
Time.Value Props
Which time value to display. Defaults to
"current".Custom negative sign character for remaining time display. Defaults to
"-". The sign is rendered aria-hidden since aria-valuetext already conveys the remaining meaning.Override the automatic
aria-label. By default: "Current time", "Duration", or "Remaining".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.
Time.Group Props
Time.Value and Time.Separator elements to group together.CSS class name for the group wrapper element.
Formatting
Time values use digital format with smart padding:- Hours are never padded (
1:05:30, not01:05:30) - Minutes are padded only when hours are shown (
1:05:30, but5:30) - Seconds are always padded (
1:05, not1:5)
Time.Group.
Accessibility
EachTime.Value element has:
aria-labelfor the static role label ("Current time","Duration","Remaining")aria-valuetextfor the dynamic human-readable time (e.g.,"1 minute, 30 seconds")datetimeattribute on the<time>element for machine-readable time
aria-live region is used — time updates too frequently and would overwhelm screen readers. Time.Separator is aria-hidden="true" since screen readers hear each value separately.