Relative Time
This is a shadcn/ui type react component that displays the relative time comparing to the current time
Demo
Installation
npx shadcn@latest add @vinkas-ui/relative-timeProperties
| Property | Type | Required | Description | Default |
|---|---|---|---|---|
| date | Date | Yes | The date to display | - |
| locale | string | No | The locale to use for formatting | "en-US" |
| style | "short" "long" "narrow" | No | The style to use for formatting | "short" |
API Reference
See the Tooltip documentation of shadcn/ui for more information. TooltipTrigger is used as the base component for RelativeTime.