U
UIPKGE

Relative Time · UIPKGE

Live relative timestamp — "2 minutes ago", "yesterday", "in 3 days" — via Intl.RelativeTimeFormat. `display` switches the label to relative, absolute, or both. `timeZone` (IANA or `UTC`) formats the clock and tooltip; omit it for the browser local zone. `parseAs` treats naive ISO strings as local or UTC. Renders a semantic <time>. Pass `now` to freeze the clock for tests and SSR.

npx shadcn@latest add https://uipkge.dev/r/react/relative-time.json
Loading the source for relative-time…

relative-time