Pass the moment. Put a TimeAgoEmpty inside for a document that nobody opened yet.
recent-documents.tsx
TimeAgo
<time>| Prop | Type | Default | Description |
|---|---|---|---|
| date | DateLike | null | — | The moment: a Date, an ISO string, epoch milliseconds, or a DateValue (#/lib/date-parse). Past and future both work. null, undefined, and a value that is not a date show the empty text. |
| kind | "elapsed""relative" | "relative" | relative (default): "5 minutes ago". elapsed: the time since date, "1m 25s". |
| length | "long""narrow""short" | — | The length of the words, the style option of Intl.RelativeTimeFormat and Intl.DurationFormat: long "5 minutes ago", short "5 min. ago", narrow "5m ago". Default: long for relative, narrow for elapsed. The prop is not named style: React and the lint read style as the CSS inline style, which a component does not take. |
| numeric | "always""auto" | "auto" | auto (default): "now", "yesterday", "tomorrow" (by local calendar day), and "last week", "next month", "last year". always: "0 seconds ago", "1 day ago", "1 week ago". |
| absolute | — | From this distance on, show the date in place of the words: "Oct 3", and "Oct 3, 2025" in another year. Milliseconds, or a count and a unit ("45s", "30m", "12h", "7d", "2w"). Default: never. | |
| locale | string | — | The BCP 47 language tag ("en-US", "ar"). Default: the DisplayLocaleProvider, else "en-US". |
| time | string | — | The IANA zone of the absolute date and the tooltip date. Default: the reader's zone. |
| now | number | Date | — | A fixed now for tests and stories. With it, the text never updates. |
| tooltip | boolean | true | Show the full date in a Tooltip on hover. Default true. |
| date | DateTimeFormatOptions | FULL_DATE_FORMAT | Intl.DateTimeFormat options of the tooltip date. Default { dateStyle: "long", timeStyle: "short" }. |
| children | ReactNode | — | A TimeAgoEmpty part: the words of no value. With a value, they are not drawn. |
| ...props | <time> attributes | — | Every other attribute goes to the <time>, with a ref. |
TimeAgoEmpty
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| data-slot | string | — | The data-slot of the root: the item's own slot ("time-ago"). Default "empty-value". |
From Base UIUseRenderBase UI docs | |||
| render | — | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
Built with
Installs with Time Ago
- Components
- Full Value



