Timeline
A vertical sequence of dated events such as claim history, an approval trail or an audit log.
Purpose
A timeline tells the story of one record over time — what happened to a claim, who approved a guarantee letter, what an audit trail recorded. Each entry is an event: a tone-coloured icon chip, a title, an optional description and a timestamp, joined by a connector rail.
Two close relatives to triage against:
- Activity feed — the card-friendly widget for a stream of recent events with hoverable rows and typed product icons. Timeline is the lower-level rail for a record's own history.
- Stepper — for steps the user still has to take. A timeline looks backwards; a stepper looks forwards.
Example
Newest first, and last on the final entry to close the rail.
Claim approved
Today, 09:41Approved by claims team A — MYR 85.00 payable.
Under review
YesterdayRouted to medical review for consultation-fee check.
Additional document requested
26 JulReceipt image was unreadable; member re-uploaded.
Claim submitted
25 JulSubmitted via member app — Klinik Mediviron, KL Sentral.
import { Timeline, TimelineItem } from "@healthmetrics/ui/timeline";
<Timeline>
<TimelineItem tone="success" glyph="check_circle" title="Claim approved" time="09:41" />
<TimelineItem tone="neutral" glyph="receipt_long" title="Claim submitted" time="Mon" last />
</Timeline>;Tones
tone colours the icon chip by outcome; glyph is any Material Symbols name (default circle).
Neutral — routine events
nowSuccess — approved, completed
nowWarning — needs attention
nowInfo — in progress, routed
nowDestructive — denied, failed
now
| Tone | Chip tokens |
|---|---|
neutral | --accent / --accent-foreground |
success | --success-subtle / --success-text |
warning | --warning-subtle / --warning-text |
info | --info-subtle / --info-text |
destructive | --destructive-subtle / --destructive-text |
Structure
The tokens behind the rail.
| Property | Value |
|---|---|
| Chip | 32px circle (size-8), 16px glyph |
| Connector | 1px --border, runs from below the chip to the next entry |
| Item gap | 12px chip-to-text (gap-3), 24px between entries (pb-6) |
| Title | 14px / Inter 500 (text-sm font-medium) |
| Description | 14px --muted-foreground |
| Timestamp | 12px --muted-foreground, right-aligned on the title line |
Best practices
Do
- Order newest first — the current state is what readers came for.
- Set
laston the final entry; the connector does not stop by itself and a dangling rail reads as a missing event. - Choose
toneby outcome (approved → success, denied → destructive) and keep the mapping consistent across the product. - Write titles as events — "Claim approved", not "Approval".
Don't
- Use it for steps still ahead of the user — that is Stepper's job.
- Rely on chip colour alone to carry the outcome; the title must say it in words.
- Load an unbounded audit log into one timeline — page it or collapse older entries.
- Rebuild the card-wrapped feed by hand — Activity feed is that composition.
Accessibility & keyboard
- Renders a semantic ordered list (
<ol>/<li>), so screen readers announce each event's position and the total count — the sequence is real structure, not just visuals. - The connector is
aria-hidden; the glyph is decorative and hidden by default. All meaning lives in the title, description and timestamp text. - Tone is colour plus nothing — which is fine only because the title carries the outcome in words. Keep it that way.
timerenders plain text, not a<time>element — prefer unambiguous formats ("26 Jul") and include the year once entries cross it.- Keyboard: none — the timeline is non-interactive. Links inside a description receive focus in DOM order.
Props
Timeline is a styled <ol> with no props of its own. TimelineItem:
| Prop | Type | Default | Description |
|---|---|---|---|
glyph | string | undefined | "circle" | Material Symbols glyph shown in the chip. |
tone | "neutral" | "success" | "warning" | "info" | "destructive" | undefined | "neutral" | Tone of the icon chip (Figma variant). |
titlerequired | React.ReactNode | — | Event title. |
description | React.ReactNode | — | Supporting line under the title. |
time | React.ReactNode | — | Right-aligned timestamp. |
last | boolean | undefined | — | Hide the connector below this item (set on the last entry). |