//data
Timeline
Vertical list of events joined by a line, for activity feeds, audit logs, deployment history and order tracking, with dot, icon or avatar markers. Copy-paste ready.
// title: Pull request activity feed with avatars and icons
import { GitMergeIcon, MessageSquareIcon, TagIcon } from "lucide-react";
import {
Avatar,
AvatarFallback,
AvatarImage,
} from "@/components/ui/avatar";
import { Badge } from "@/components/ui/badge";
import {
Timeline,
TimelineContent,
TimelineDescription,
TimelineIndicator,
TimelineItem,
TimelineTime,
TimelineTitle,
} from "@/components/ui/timeline";
export default function Particle() {
return (
<div className="w-full max-w-md rounded-xl border p-5">
<p className="mb-4 font-medium text-sm">Activity</p>
<Timeline>
<TimelineItem>
<TimelineIndicator className="overflow-hidden border-0">
<Avatar className="size-full">
<AvatarImage
alt=""
src="https://images.unsplash.com/photo-1543610892-0b1f7e6d8ac1?w=96&h=96&dpr=2&q=80"
/>
<AvatarFallback>MP</AvatarFallback>
</Avatar>
</TimelineIndicator>
<TimelineContent>
<TimelineTitle>
<strong>Maya Patel</strong> commented
</TimelineTitle>
<TimelineDescription className="rounded-lg border bg-muted/40 px-3 py-2">
Retry logic looks good. Can we cap the backoff at 30s?
</TimelineDescription>
<TimelineTime dateTime="2026-10-19T14:12">12 min ago</TimelineTime>
</TimelineContent>
</TimelineItem>
<TimelineItem>
<TimelineIndicator>
<TagIcon />
</TimelineIndicator>
<TimelineContent>
<TimelineTitle>
<strong>Leo Park</strong> added{" "}
<Badge size="sm" variant="outline">
needs-review
</Badge>
</TimelineTitle>
<TimelineTime dateTime="2026-10-19T11:40">2 hours ago</TimelineTime>
</TimelineContent>
</TimelineItem>
<TimelineItem>
<TimelineIndicator>
<MessageSquareIcon />
</TimelineIndicator>
<TimelineContent>
<TimelineTitle>
<strong>Ana Ruiz</strong> requested changes
</TimelineTitle>
<TimelineTime dateTime="2026-10-18T17:05">Yesterday</TimelineTime>
</TimelineContent>
</TimelineItem>
<TimelineItem>
<TimelineIndicator className="border-primary bg-primary text-primary-foreground">
<GitMergeIcon />
</TimelineIndicator>
<TimelineContent>
<TimelineTitle>
<strong>Leo Park</strong> opened #482: Retry failed webhooks
</TimelineTitle>
<TimelineTime dateTime="2026-10-17T09:30">Oct 17</TimelineTime>
</TimelineContent>
</TimelineItem>
</Timeline>
</div>
);
}
Installation
pnpm dlx shadcn@latest add @cnippet/timeline
Usage
import {
Timeline,
TimelineContent,
TimelineDescription,
TimelineIndicator,
TimelineItem,
TimelineTime,
TimelineTitle,
} from "@/components/ui/timeline"<Timeline>
<TimelineItem>
<TimelineIndicator />
<TimelineContent>
<TimelineTitle>Shipped</TimelineTitle>
<TimelineTime dateTime="2026-10-16T10:30">Oct 16, 10:30 AM</TimelineTime>
</TimelineContent>
</TimelineItem>
</Timeline>Anatomy
<Timeline> {/* <ol> */}
<TimelineItem> {/* <li>; draws the line to the next item */}
<TimelineIndicator /> {/* a dot, or pass an icon or avatar */}
<TimelineContent>
<TimelineTitle />
<TimelineDescription />
<TimelineTime /> {/* <time>; pass dateTime */}
</TimelineContent>
</TimelineItem>
</Timeline>Good to know
- Every indicator fills the same square, set by
--timeline-indicatoronTimeline(default--spacing(7)), so dots, icons and avatars all sit on one line. Make it smaller for compact lists:className="[--timeline-indicator:--spacing(4)]". TimelineIndicatoris hidden from screen readers. Put any status it shows (such as "Failed") in the text as well.- The last item has no line after it.
- Give
TimelineTimea machine-readabledateTimewhen the visible text is relative, such as "2 hours ago". <strong>insideTimelineTitleis medium weight, for the actor's name in activity feeds.
API Reference
All parts take the props of their HTML element. TimelineIndicator renders a dot when it has no children, and a bordered circle around them when it does.
Examples
Deployment history
Status icons in tinted indicators.
// title: Deployment history with status indicators
import { CheckIcon, LoaderIcon, XIcon } from "lucide-react";
import {
Timeline,
TimelineContent,
TimelineDescription,
TimelineIndicator,
TimelineItem,
TimelineTime,
TimelineTitle,
} from "@/components/ui/timeline";
const DEPLOYS = [
{
commit: "a41f2c9",
message: "Add saved views",
status: "building",
time: "Building · 1m 12s",
},
{
commit: "9be07d1",
message: "Fix timezone in exports",
status: "ready",
time: "Ready · 14 min ago",
},
{
commit: "3c5a8e0",
message: "Bump Next.js to 16.4",
status: "failed",
time: "Failed · 1 hour ago",
},
{
commit: "e20d4b7",
message: "Cache pricing page",
status: "ready",
time: "Ready · 3 hours ago",
},
] as const;
const INDICATOR = {
building: {
className: "border-info/32 bg-info/8 text-info-foreground",
icon: <LoaderIcon className="animate-spin" />,
},
failed: {
className:
"border-destructive/32 bg-destructive/8 text-destructive-foreground",
icon: <XIcon />,
},
ready: {
className: "border-success/32 bg-success/8 text-success-foreground",
icon: <CheckIcon />,
},
};
export default function Particle() {
return (
<div className="w-full max-w-sm rounded-xl border p-5">
<p className="mb-4 font-medium text-sm">Deployments · production</p>
<Timeline>
{DEPLOYS.map((d) => (
<TimelineItem key={d.commit}>
<TimelineIndicator className={INDICATOR[d.status].className}>
{INDICATOR[d.status].icon}
</TimelineIndicator>
<TimelineContent className="gap-0.5">
<TimelineTitle>{d.message}</TimelineTitle>
<TimelineDescription className="font-mono text-xs">
{d.commit}
</TimelineDescription>
<TimelineTime>{d.time}</TimelineTime>
</TimelineContent>
</TimelineItem>
))}
</Timeline>
</div>
);
}
Order tracking
Compact dots with the latest step highlighted.
// title: Order tracking with compact dots
import {
Timeline,
TimelineContent,
TimelineDescription,
TimelineIndicator,
TimelineItem,
TimelineTime,
TimelineTitle,
} from "@/components/ui/timeline";
const STEPS = [
{
place: "San Francisco, CA",
time: "Oct 19, 8:02 AM",
title: "Out for delivery",
},
{
place: "Oakland, CA",
time: "Oct 18, 9:41 PM",
title: "Arrived at local facility",
},
{ place: "Reno, NV", time: "Oct 17, 6:15 PM", title: "In transit" },
{ place: "Denver, CO", time: "Oct 16, 10:30 AM", title: "Shipped" },
];
export default function Particle() {
return (
<div className="w-full max-w-sm rounded-xl border p-5">
<div className="mb-4">
<p className="font-medium text-sm">Order #10482</p>
<p className="text-muted-foreground text-xs">Arrives today by 8 PM</p>
</div>
<Timeline className="[--timeline-indicator:--spacing(4)]">
{STEPS.map((step, i) => (
<TimelineItem className="pb-5" key={step.title}>
<TimelineIndicator
className={
i === 0
? "before:bg-primary before:ring-4 before:ring-primary/16"
: undefined
}
/>
<TimelineContent className="gap-0.5">
<div className="flex items-baseline justify-between gap-3">
<TimelineTitle className={i === 0 ? "font-medium" : undefined}>
{step.title}
</TimelineTitle>
<TimelineTime className="shrink-0">{step.time}</TimelineTime>
</div>
<TimelineDescription className="text-xs">
{step.place}
</TimelineDescription>
</TimelineContent>
</TimelineItem>
))}
</Timeline>
</div>
);
}