Skip to Content
BBRICKSv0.7.4
BlocksActivity

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.

activityLog
KeyEnglishArabic
labelActivity logسجل النشاط
open· open →· افتح ←
emptyNothing 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

  1. List: ol.kit-tl.kit-blk-log, named "Activity log"; rail at the inline start.
  2. Event: li.kit-tl-ev with the dot coloured by tone.
  3. Event body: button.kit-blk-ev when onOpen is set, else a div:
    1. Title .kit-blk-ev-t + muted "· open →" when openable;
    2. When .kit-blk-ev-at, muted;
    3. Detail .kit-tl-d: soft grey box, 13px.
  4. States (from the shared BlockState): skeleton rows (aria-busy), error box (--rasp-50, --bad text, Try again), empty line.

Variants

toneDotMeaning
ok--okApproved, paid.
bad--badRejected.
rasp--raspYour request.
sky--sky-inkYour invite.
butter--butter-inkStopped, paused.

States

StateTrigger
Readystatus="ready" (default) with events.
Loadingstatus="loading": 3 skeleton rows, "Loading…" for screen readers.
Errorstatus="error": error text (or a generic message) + "Try again" when onRetry is set.
Emptyready with events=[]: "Nothing here yet."
Openable eventonOpen: the whole event is a button; hover turns the title --rasp-d.
Focus-visiblefocus ring around the event.
Mixed scriptArabic 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 in BrandSubScreens).

Guidelines

Do

  • Write titles as "who did what", bold the object; keep at as "relative · absolute".
  • Give onOpen to every event whose subject still exists.

Don't

  • Don't sort on the client; render the server's order.
  • Don't put buttons inside title or detail (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-busy with a hidden "Loading…"; errors are role="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.

See also: useLanguage · Card

Source

src/blocks/activity/ActivityLog.tsx (line 53) on GitHub.

On this page