Activity feed
A short list of recent events that updates in place: deploys, alerts, sign-ups, payments. Your code owns the list and adds new events at the start; the feed animates the arrival. Press New data to add an event. For a full history with paging, use a table.
Install
npx shadcn@latest add @thrum-pro/activity-feedThis is a Pro component. The command works once your project has a licence key: set up Pro or see pricing.
Data shape
type ActivityFeedItem = {
id: string; // stable and unique
title: string;
detail?: string; // second line
time: string; // ready to print: "2 min ago"
status?: "normal" | "ok" | "warn" | "alarm";
};[
{ id: "evt_1042", title: "Deploy finished", time: "Just now", status: "ok" },
{ id: "evt_1041", title: "Error rate above 2%", detail: "checkout-service", time: "2 min ago", status: "warn" },
{ id: "evt_1040", title: "Invoice paid", time: "5 min ago" },
]Props
| Prop | Type | Default | Description |
|---|---|---|---|
items | readonly ActivityFeedItem[] | Required | Events, newest first. The feed tells a new event from an old one by its id. |
label | string | Required | What the feed shows. It is the name screen readers hear. |
max | number | Default 6 | How many items are shown. Older ones leave as new ones arrive. |
sound | boolean | Default true | Play a soft click when an item arrives, if the visitor has sound on. |
emptyLabel | string | Default "No data" | Text shown when the list is empty. |
className | string | – | Sets the width. The feed fills the width it is given and is as tall as its items. |
Motion and sound
Motion
- A new item slides down from the top edge while the items below move down by its height, all on the same spring (stiffness 700, damping 48). It settles in about 250 ms with under 1% overshoot.
- An item pushed past the limit slides out under the bottom edge and fades in 150 ms.
- The feed does not animate when it first appears, and nothing in it loops. It only moves when the list changes.
- While the pointer is over the feed, or it has keyboard focus, the list stands still and a small “2 new” label in the bottom corner counts what is waiting. The waiting items arrive when the pointer or the focus leaves.
- Reduced motion: items appear and leave at once.
Sound
- A soft click with a high tone when an item arrives at the top. Several arriving together play it once. Silent when the feed first appears and when items only leave.
Sound is off until the visitor turns it on. Pass sound={false} to keep this component silent. How sound works
Accessibility
- The feed is a log with polite announcements: a screen reader reads a new item when it is idle, and does not interrupt.
- Status is a coloured lamp plus a hidden word before the title: “OK:”, “Warning:” or “Alarm:”. Write titles that also make sense with no lamp.
- The feed is one tab stop so that keyboard users can hold it still. The items themselves are text and take no focus.
- Time is printed as given. The feed does no date arithmetic, so refresh the strings yourself.
- The hidden status words and the “new” label are in English and fixed in this version.
| Keys | Action |
|---|---|
| Tab | Focus the feed. New items wait until focus leaves, so the list does not move while it is being read. |
Source
The source comes with Pro
TypeScript source · Copy-paste ready · MIT-compatible for client projects · Includes all dependencies
Files and dependencies
- Adds
components/ui/activity-feed.tsx- Packages
motion- Brings along
- Chart foundationsMotion tokensSound engine
Changelog
- 1.0.0 · 2026-12-02First release.