ActivityLog
The Activity log's timeline (.tl): a rail with a coloured dot per event, what happened, "· open →", when, and the detail box. An event that leads somewhere is one button. In the order given (the server sorts); the caller's filter chips sit above it. Loading, error and "Nothing here yet." states. The title, when and detail are the app's words: each is isolated in its own script's direction (B15), as in Timeline.
import { ActivityLog } from '@ergasti/bricks';Examples
Activity log
Dated events with a coloured dot; give an event onOpen and it opens what it is about. Loading, error and empty are built in.
Code
import { ActivityLog, Card, useLanguage } from '@ergasti/bricks';
import { blocksData } from './sample-data';
function Log() {
const language = useLanguage();
return (
<div style={{ maxWidth: 620, display: 'grid', gap: 16 }}>
<Card><ActivityLog events={blocksData.LOG[language].slice(0, 4).map(([tone, title, at, detail], i) => ({ id: i, tone, title, at, detail: detail || undefined, onOpen: () => {} }))} /></Card>
<Card><ActivityLog events={[]} status="loading" /></Card>
<Card><ActivityLog events={[]} /></Card>
</div>
);
}Error with Try again
status="error" shows error (a human sentence; the kit's generic one when left out) with a "Try again" button wired to onRetry.
Code
import { ActivityLog, Card } from '@ergasti/bricks';
function Failed() {
return <div style={{ maxWidth: 620 }}><Card><ActivityLog events={[]} status="error" error="The activity log could not be loaded." onRetry={() => {}} /></Card></div>;
}Props
Prop
Type
Labels
Every word this component draws, in both languages. Override one per component and language with BricksProvider labels under the key activityLog, or with the component's own prop where it has one. A {name} is a value the component fills in.
| Key | English | Arabic |
|---|---|---|
label | Activity log | سجل النشاط |
open | · open → | · افتح ← |
empty | Nothing here yet. | لسه مفيش حاجة هنا. |
Design guidance
How the BRICKS design system uses ActivityLog. Written in docs/content/components/ActivityLog.md; the props above are read from the code, which wins where the two disagree.
The brand's activity timeline: a rail with a coloured dot per event, the sentence, "· open →", when, and a detail box, where each event that leads somewhere is one button; use it for the Activity log screen.
It is the mock's P.log .tl on Brand › Activity log ("TRNDR team approved Karim Hosny's join request · open →", "2 hours ago · 13 Nov 2026 11:20", "Coupon KARI0329 created."). It extends the kit Timeline with an open action per event and the block states (loading skeleton, error with Try again, "Nothing here yet."). Events are drawn in the order given (the server sorts); the filter chips and the day filter sit above it in a ListToolbar (chips, date).
Anatomy
- List:
ol.kit-tl.kit-blk-log, named "Activity log"; rail at the inline start. - Event:
li.kit-tl-evwith the dot coloured bytone. - Event body:
button.kit-blk-evwhenonOpenis set, else adiv:- Title
.kit-blk-ev-t+ muted "· open →" when openable; - When
.kit-blk-ev-at, muted; - Detail
.kit-tl-d: soft grey box, 13px.
- Title
- States (from the shared
BlockState): skeleton rows (aria-busy), error box (--rasp-50,--badtext, Try again), empty line.
Variants
tone | Dot | Meaning |
|---|---|---|
ok | --ok | Approved, paid. |
bad | --bad | Rejected. |
rasp | --rasp | Your request. |
sky | --sky-ink | Your invite. |
butter | --butter-ink | Stopped, paused. |
States
| State | Trigger |
|---|---|
| Ready | status="ready" (default) with events. |
| Loading | status="loading": 3 skeleton rows, "Loading…" for screen readers. |
| Error | status="error": error text (or a generic message) + "Try again" when onRetry is set. |
| Empty | ready with events=[]: "Nothing here yet." |
| Openable event | onOpen: the whole event is a button; hover turns the title --rasp-d. |
| Focus-visible | focus ring around the event. |
| Mixed script | Arabic page with Latin names / dates: each part is isolated. |
Types
ActivityEvent: id: string | number, tone: 'ok' | 'bad' | 'rasp' | 'sky' | 'butter', title: ReactNode, at: ReactNode, detail?: ReactNode, onOpen?: () => void.
ActivityLogCopy (labels): label ("Activity log"), open ("· open →"), empty ("Nothing here yet.").
Usage
// Brand › Activity log
type Kind = 'all' | 'requests' | 'invites' | 'payouts';
const kinds: FilterOption<Kind>[] = [
{ value: 'all', label: 'All' }, { value: 'requests', label: 'Join requests' },
{ value: 'invites', label: 'Invites' }, { value: 'payouts', label: 'Payouts' },
];
const [kind, setKind] = useState<Kind>('all');
const [day, setDay] = useState('');
<>
<PageHeader title="Activity log" subtitle="Everything that happened in your program" />
<Card>
<ListToolbar<Kind>
chips={{ label: 'Show', value: kind, options: kinds, onChange: setKind }}
date={{ label: 'Day', value: day, onChange: setDay }}
reset={{ active: kind !== 'all' || day !== '', onReset: () => { setKind('all'); setDay(''); } }}
actions={<Button onClick={exportCsv}>Export CSV</Button>}
/>
<ActivityLog status={log.status === 'idle' ? 'ready' : log.status} error={log.error?.message} onRetry={log.reload} events={log.data?.map((e) => ({
id: e.id, tone: e.tone, at: `${e.ago} · ${e.date}`, detail: e.detail,
title: <>TRNDR team approved <b>{e.creator}</b>'s join request</>,
onOpen: () => openCreator(e.creatorId),
})) ?? []} />
</Card>
</>Where it appears
- In the v3 mocks: Brand › Activity log › the clickable timeline (
P.log.tl) (activity screen inBrandSubScreens).
Guidelines
Do
- Write titles as "who did what", bold the object; keep
atas "relative · absolute". - Give
onOpento every event whose subject still exists.
Don't
- Don't sort on the client; render the server's order.
- Don't put buttons inside
titleordetail(the event is already a button).
RTL and Arabic
- Rail and dots mirror; "· افتح ←" points the reading way.
- Each title, time and detail is isolated, so "فريق TRNDR وافق على طلب Karim Hosny" and "13 Nov 2026 11:20" do not reorder.
- Empty: "لسه مفيش حاجة هنا."
Tokens
--line, --soft, --ink-2, --ink-3, --ok, --bad, --rasp, --rasp-d, --rasp-50, --sky-ink, --butter-ink, --focus-ring.
Accessibility
- An
<ol>named "Activity log"; an openable event is one<button>whose name is the title, "open", when and detail. - Loading is
aria-busywith a hidden "Loading…"; errors arerole="alert". - Dots are decorative; the sentence states the outcome.
Found in the source
- ARIA attributes set:
aria-label.
Read from the component's source and tests. See Accessibility for the patterns the library follows.
Related
Timeline: the read-only kit timeline.ListToolbar(withchipsanddate): the controls above it.StepTimeline: fixed delivery steps.
See also: useLanguage · Card
Source
src/blocks/activity/ActivityLog.tsx (line 53) on GitHub.