# Relative time

A time such as 5 minutes ago, with the exact date on hover.

Import from `@a31labs/rax/relative-time`.

## Usage

```tsx
<RelativeTime date={deployedAt} />
```

## Rules

Props: `date` (Date, ISO string or ms), `locale`, `now` (fixes the reference time, for tests). Renders `<time dateTime={ISO}>` with "5 minutes ago" or "in 2 days" (`Intl.RelativeTimeFormat`, `numeric: "auto"`) and the absolute date (dateStyle medium, timeStyle short) as `title`. The server and first render show the absolute date, so hydration matches; the relative text replaces it after mount. Dates under an hour away update every 30s.

Page: https://rax.a31.at/components/relative-time
