Looking for the old docs? Go here

Display

Time

This component is used to display certain media states as a unit of time, such as the current time or duration.

HTMLAttributes
Ref<HTMLElement>

Outputs a media duration (eg: currentTime, duration, bufferedAmount, etc.) value as time formatted text.

import { Time, type TimeProps } from "@vidstack/react";
<Time type="current" />
PropTypeDefault
asChild
boolean
false
children
ReactNode
null
hidden
boolean
false
padHours
boolean
null
padMinutes
boolean
null
remainder
boolean
false
showHours
boolean
false
toggle
boolean
false
type
string
'current'
/* Example. */
.component[data-foo] {}
NameDescription
data-type
The type prop setting (current, duration, etc.).
data-remainder
Whether time remaining is being shown.

Previous