Activity feed comes with Pro. Its preview shows once you unlock it.
Usage
import { DashboardActivity } from './DashboardActivity.jsx'
// Without events the feed shows its sample morning. Wire it to yours, with your own types of event:
<DashboardActivity
locale="en"
filters={[
{ id: 'sales', label: 'Sales', icon: 'bag', tone: 'secondary' },
{ id: 'roasts', label: 'Roasts', icon: 'flame' },
{ id: 'team', label: 'Team', icon: 'user', tone: 'tertiary' },
]}
events={feed.events} // [{ id, type: a filter id, actor?, text, at, unread?, warn?, icon? }]
incoming={feed.incoming} // arrived since: shown behind the "new" pill
onShowNew={(events) => feed.merge(events)}
onOpen={(event) => openEvent(event.id)}
onMarkAllRead={() => feed.markAllRead()}
loading={feed.loading}
error={feed.error}
onRetry={feed.reload}
/>Props
| Prop | Type | Default | What it does |
|---|---|---|---|
locale | 'en' | 'zh-CN' | 'es' | 'ja' | 'en' | Language of the built-in text, the sample events and the time format. |
events | Array<{ id, type, actor?, text, at, unread?, warn?, icon?, tone? }> | sample morning | Newest first. type is the id of one of `filters`, whose icon and tint the event takes unless it brings its own icon (a kit icon name or a node); at is a date or date string; warn marks a problem. Events not seen before grow in at the top. |
filters | Array<{ id, label, icon?, tone?: 'secondary' | 'tertiary' }> | orders, kitchen, team | The tabs after “All”, one per type of event, with the icon (a kit icon name, “flame” or a node) and tint their events take. |
incoming | Array<event> | [] | Events that arrived while the feed was open: they wait behind the “new” pill. |
now | Date | string | now | What counts as today, for the Today and Yesterday headings. |
onOpen | (event) => void | — | An event was opened; it is marked read. |
onShowNew | (events) => void | — | The “new” pill was opened with these events. |
onMarkAllRead | () => void | — | Everything was marked read. |
loading | boolean | false | Shows the skeleton of the feed. |
error / onRetry | boolean | string / () => void | false | Shows the error banner with a retry button; a string replaces its sentence. |
labels | object | — | Replaces any built-in text (keys as in copy.js). |
Add it to your project
Pro includes the full source of this block. Copy its prompt to install it with your coding agent.
DashboardActivity.jsxdashboard-activity.csscopy.jskit.jsxkit.cssui/base-button/ui/empty-state/ui/alert-banner/ui/skeleton-shimmer/ui/sliding-tabs/tokens.cssREADME.md
The block, its stylesheet and text, the shared kit, the components it uses and tokens.css install together into one folder.
