Skip to Content
BBRICKSv0.7.4
KitPatterns

Timeline

The mock's .tl: an <ol> in the order given (the server sorts), a rail at 8px, 12px dots with a white ring. Title, time and detail are the app's words: each is isolated in its own script's direction (B15).

import { Timeline } from '@ergasti/bricks';

Examples

Activity

Dated events with a coloured dot, a title and an optional detail line.

Code
import { Card, Timeline } from '@ergasti/bricks';

function Events() {
  return (
    <div style={{ maxWidth: 520 }}>
      <Card>
        <Timeline
          events={[
            { id: 1, tone: 'ok', title: 'TRNDR team approved Karim Hosny’s join request', at: '2 hours ago · 13 Nov 2026 11:20', detail: 'Coupon KARI0329 created.' },
            { id: 2, tone: 'bad', title: 'TRNDR team rejected your challenge request Ramadan preview', at: '5 hours ago · 13 Nov 2026 08:02', detail: 'Reason: dates overlap with Winter glow launch.' },
            { id: 3, tone: 'rasp', title: 'You requested the challenge Lip oil bundle push', at: 'Yesterday · 12 Nov 2026 16:45' },
          ]}
        />
      </Card>
    </div>
  );
}

Props

Prop

Type

Design guidance

How the BRICKS design system uses Timeline. Written in docs/content/components/Timeline.md; the props above are read from the code, which wins where the two disagree.

A vertical, read-only event list with a rail and coloured dots, each event with a title, a time and an optional detail box; use it for a short history (a fraud case, a shipment) where events are not clickable.

It is the mock's .tl: an ordered list in the order the server gives, a 2px rail 8px in from the start, 12px dots with a white ring coloured by tone. Title, time and detail are app words, each isolated in its own script's direction. When each event must open something, use ActivityLog, which adds an open action, loading and empty states.

Anatomy

  1. List: ol.kit-tl, padding-inline-start 28px; ::before is the --line rail.
  2. Event: li.kit-tl-ev, padding 4px 0 18px; ::before is the dot, colour from --c.
  3. Title: first line.
  4. Time: .kit-muted line ("Today, 09:14").
  5. Detail (optional): .kit-tl-d, --soft box, radius 12, 13px --ink-2, 8px under.

Variants

toneDot colourWhen to use
ok--okApproved, paid, delivered.
bad--badRejected, failed, flagged.
rasp--raspBrand actions, neutral highlights.
sky--sky-inkInformation, messages.
butter--butter-inkWaiting, paused.

States

StateTrigger
Eventsevents non-empty.
One eventthe rail spans the single row.
Emptyevents=[] renders an empty list; show your own empty text instead.
With detaildetail adds the soft box.

Types

TimelineEvent: id: string | number (key), tone: 'ok' | 'bad' | 'rasp' | 'sky' | 'butter', title: ReactNode, at: ReactNode, detail?: ReactNode.

Usage

<Card title="Case history">
  <Timeline events={[
    { id: 1, tone: 'bad', title: 'Flagged: 14 orders from one address', at: 'Today, 09:14' },
    { id: 2, tone: 'sky', title: 'Creator asked for a review', at: 'Today, 11:02', detail: '"These are my family orders, all real."' },
    { id: 3, tone: 'ok', title: 'Cleared by Mona from TRNDR', at: 'Today, 15:40' },
  ]} />
</Card>
// Empty state handled by the caller
{events.length ? <Timeline events={events} /> : <EmptyView title="Nothing has happened yet" />}

Where it appears

  • In the v3 mocks: none directly. The Brand Activity log's clickable timeline is ActivityLog.
  • Library only: PR fraud case history (FraudCaseDetail; no fraud screen in the v3 mocks); kit gallery.

Guidelines

Do

  • Keep titles to one sentence in past tense; put the actor in the title.
  • Use tones consistently with StatusPill meanings.

Don't

  • Don't make events clickable by wrapping them; use ActivityLog.
  • Don't render more than ~20 events without paging.

RTL and Arabic

  • Rail and dots use logical insets and move to the right in RTL.
  • Isolated titles keep Latin names and numbers in order inside Arabic sentences.

Tokens

--line, --soft, --ink-2, --ok, --bad, --rasp, --sky-ink, --butter-ink, --c (per event).

Accessibility

  • A semantic <ol>; order is meaningful. Dots are decorative (pseudo-elements), so the title must state the outcome.
  • Text parts are isolated for mixed scripts.

Found in the source

  • No roles, ARIA attributes or key handling are set in this component's own source; it renders native elements and the components it composes.

Read from the component's source and tests. See Accessibility for the patterns the library follows.

See also: Card · Accordion · HeroCard · KeyValue

Source

src/kit/patterns/Timeline.tsx (line 19) on GitHub.

On this page