Relative Time
Displays a human-readable relative timestamp that updates automatically.
Usage
Props
| Prop | Type | Default | Description |
|---|---|---|---|
date* | Date | string | number | - | The reference date to display relative to now. |
autoUpdate | boolean | true | Automatically refresh the displayed text on an interval. |
updateInterval | number | 30000 | Interval in milliseconds between automatic updates. |
locale | string | 'en' | Locale for the Intl.RelativeTimeFormat formatter. |
as | string | 'time' | The HTML element to render as. |