Vinkas UI

Relative Time

This is a shadcn/ui type react component that displays the relative time comparing to the current time

Demo

  import { RelativeTime } from '@/registry/vinkas/ui/relative-time'

  export function InputCopyableDemo() {
    return <RelativeTime date={new Date()} />
  }

Installation

npx shadcn@latest add @vinkas-ui/relative-time
Make sure you already have the @vinkas-ui registry added to your components.json file. Read the installation guide for more information.

API Reference

See the Tooltip documentation of shadcn/ui for more information. TooltipTrigger is used as the base component for RelativeTime.