Object Timeline
ObjectTimeline renders a vertical record of events. Each item has an icon and a title, and can add a description, a date and an onClick that turns the title into a button. Click the receipt.
@dentil/object-timelineOn this page
- Payment created from invoice INV-10427 Nov 2026, 09:14
- Delivered7 Nov 2026, 09:15
- Payment succeeded7 Nov 2026, 09:16
- £25.00 refunded to the customerRequested by the customer7 Nov 2026, 11:02
—components/demos/object-timeline-overview.tsx
'use client';
import { useState } from 'react';
import { Banknote, CreditCard, Mail, RotateCcw } from 'lucide-react';
import { ObjectTimeline } from '@/components/dentil/object-timeline/object-timeline';
export function ObjectTimelineOverviewDemo() {
const [opened, setOpened] = useState<string>();
return (
<div className="flex w-full max-w-md flex-col gap-4">
<ObjectTimeline
items={[
{
id: 'created',
icon: CreditCard,
title: 'Payment created from invoice INV-1042',
date: '7 Nov 2026, 09:14',
},
{
id: 'sent',
icon: Mail,
iconClassName: 'text-primary',
title: 'Receipt sent to ada@example.com',
description: 'Delivered',
date: '7 Nov 2026, 09:15',
onClick: () => setOpened('Receipt'),
},
{
id: 'paid',
icon: Banknote,
title: 'Payment succeeded',
date: '7 Nov 2026, 09:16',
},
{
id: 'refund',
icon: RotateCcw,
iconClassName: 'text-destructive',
title: '£25.00 refunded to the customer',
description: 'Requested by the customer',
date: '7 Nov 2026, 11:02',
},
]}
/>
<span className="text-muted-foreground text-sm">
Result: <code className="text-foreground">{opened ?? '—'}</code>
</span>
</div>
);
}Installation
pnpm dlx shadcn@latest add @dentil/object-timelinenpx shadcn@latest add @dentil/object-timelineyarn dlx shadcn@latest add @dentil/object-timelinebunx --bun shadcn@latest add @dentil/object-timelineFiles land in components/dentil/object-timeline/. It has no stock shadcn dependencies. Pass any icon component that accepts className and size, such as one from lucide-react.
Usage
import { CreditCard, Mail } from 'lucide-react';
import { ObjectTimeline } from '@/components/dentil/object-timeline/object-timeline';
<ObjectTimeline
items={[
{
id: 'created',
icon: CreditCard,
title: 'Payment created from an invoice',
date: '7 Nov 2026, 09:14',
},
{
id: 'sent',
icon: Mail,
iconClassName: 'text-primary',
title: 'Receipt sent to ada@example.com',
description: 'Delivered',
date: '7 Nov 2026, 09:15',
onClick: () => openReceipt(),
},
]}
/>Items without onClick stay plain text. The title is the button label when you pass one, so keep that title as text rather than nesting another link inside it.
API reference
ObjectTimeline
| Prop | Type | Default | Description |
|---|---|---|---|
| items | ObjectTimelineItem[] | — | Events, in the order they render. The first item is at the top. |
| className | string | — | Merged onto the list. |
| …props | ComponentProps<'ol'> | — | Other props (aria-label, id…) are passed to the list. |
ObjectTimelineItem
| Prop | Type | Default | Description |
|---|---|---|---|
| id | number | string | — | Stable identity for the row. |
| date | ReactNode | — | Secondary line under the description. Omit it when the event has no time. |
| title | ReactNode | — | The event. With onClick, this becomes the button label. |
| description | ReactNode | — | Muted line between the title and the date. |
| icon | ComponentType<{ className?: string; size?: number }> | — | Drawn at 14px on the rail. Lucide icons match this type. |
| iconClassName | string | — | Colour and other classes for the icon. Defaults to text-muted-foreground. |
| onClick | () => void | — | When set, the title is a button. Omit it for a record that does nothing. |