Activity feed
A timeline of events with tone dots, avatars and relative timestamps.
The variant of an item colours its dot: create, update, delete, comment or status-change. ActivityFeedTimestamp writes the time as it stands when the page is drawn (3 days ago) and does not count on afterwards.
Default
Product commented on the launch checklist
Billing migration moved to In review
The due date of INV-1042 changed to 30 November
The draft of release 4.1.3 was deleted
The project Atlas redesign was created
import {
ActivityFeed,
ActivityFeedContent,
ActivityFeedItem,
ActivityFeedTimestamp,
} from "@/components/ui/activity-feed"
const events = [
{ variant: "comment", text: "Product commented on the launch checklist", at: "2026-11-18T16:20:00Z" },
{ variant: "status-change", text: "Billing migration moved to In review", at: "2026-11-16T09:05:00Z" },
{ variant: "update", text: "The due date of INV-1042 changed to 30 November", at: "2026-11-10T13:40:00Z" },
{ variant: "delete", text: "The draft of release 4.1.3 was deleted", at: "2026-10-28T11:15:00Z" },
{ variant: "create", text: "The project Atlas redesign was created", at: "2026-09-30T08:00:00Z" },
] as const
export default function ActivityFeedDefault() {
return (
<ActivityFeed role="list" className="w-full max-w-sm">
{events.map((event) => (
<ActivityFeedItem key={event.at} role="listitem" variant={event.variant}>
<ActivityFeedContent>{event.text}</ActivityFeedContent>
<ActivityFeedTimestamp date={event.at} />
</ActivityFeedItem>
))}
</ActivityFeed>
)
}
With avatars
Ines Quill approved release 4.2.0
Tam Rook attached the test report
Wren Alder opened the release
import {
ActivityFeed,
ActivityFeedAvatar,
ActivityFeedContent,
ActivityFeedItem,
ActivityFeedTimestamp,
} from "@/components/ui/activity-feed"
import { Avatar, AvatarFallback } from "@/components/ui/avatar"
const events = [
{ name: "Ines Quill", initials: "IQ", did: "approved release 4.2.0", variant: "status-change", at: "2026-11-18T10:30:00Z" },
{ name: "Tam Rook", initials: "TR", did: "attached the test report", variant: "update", at: "2026-11-17T15:45:00Z" },
{ name: "Wren Alder", initials: "WA", did: "opened the release", variant: "create", at: "2026-11-12T09:00:00Z" },
] as const
export default function ActivityFeedWithAvatars() {
return (
<ActivityFeed role="list" className="w-full max-w-sm">
{events.map((event) => (
<ActivityFeedItem key={event.at} role="listitem" variant={event.variant}>
<div className="flex items-center gap-2">
<ActivityFeedAvatar>
<Avatar size="xs" aria-hidden>
<AvatarFallback name={event.name}>{event.initials}</AvatarFallback>
</Avatar>
</ActivityFeedAvatar>
<ActivityFeedContent>
<span className="font-medium">{event.name}</span> {event.did}
</ActivityFeedContent>
</div>
<ActivityFeedTimestamp date={event.at} />
</ActivityFeedItem>
))}
</ActivityFeed>
)
}
Installation
npx shadcn@latest add @khaeli/activity-feedbunx --bun shadcn@latest add @khaeli/activity-feedInstall @khaeli/foundation first: this item's styling lives in its tokens and [data-slot] rules.
Installs with
- Registry items
Accessible name
- The dot is hidden from assistive technology and its colour is the only thing the variant changes, so the sentence must say what happened: deleted, commented, moved to In review.
- The feed and its items are plain
divs. Give the feedrole="list"and each itemrole="listitem"so the events are counted and read as a list. ActivityFeedTimestampis atimeelement: the relative text is read, anddateTimeholds the exact moment.- An avatar beside the person's name is decoration: hide it with
aria-hidden.
Registry JSON
The item as the shadcn CLI reads it, with every file it ships: https://ui.khaeli.com/r/activity-feed.json