Skip to content
Harness Design System Harness Design System Harness Design System

Time Ago Card

beta

The TimeAgoCard component displays a timestamp in a human-readable format, such as “5 minutes ago”. It also provides an option to view the full date and time when clicked.

Usage

import { TimeAgoCard } from "@/components";
//...
return (
<TimeAgoCard timestamp={new Date().toISOString()} />
);

Timestamp variants

Time difference examples

The component displays relative time in a narrow format for all time ranges:

Future timestamps

The component also handles future timestamps:

With prefix

API Reference

Prop
Required
Default
Type
timestampfalse'string' | 'number' | 'null'
prefixfalse'string'
textPropsfalse'TextProps'
tooltipPropsfalse'TooltipProps'
triggerClassNamefalse'string'
triggerPropsfalse'ButtonHTMLAttributes<HTMLButtonElement>'