Skip to content
English

How it works

An ordered list where each entry is a two-column grid: the marker and a hairline rail that runs from under it to the next marker, so the line never pokes out past the last entry. Markers are soft tinted discs with a 15px icon, or ringed dots; neutral entries stay grey so coloured ones stand out. The actor is set in ink and the action in a quieter grey, with the time right-aligned in tabular figures. On mount entries rise in one after another and each rail segment draws downward. A detail opens by animating grid rows from 0fr to 1fr, so nothing is measured, and it is inert while closed.

Use it for

  • The history of one object: a release, a ticket, a document, a shipment.
  • An audit trail where who did what, and when, matters more than the exact values.

Look elsewhere when

  • Many unrelated events that people filter and sort: use a table.

Usage

import { Timeline } from './Timeline.jsx'

export function ReleaseActivity({ events }) {
  return (
    <Timeline
      label="Release activity"
      items={events.map((e) => ({
        id: e.id,
        actor: e.who,
        title: e.what,
        time: e.relativeTime,
        dateTime: e.iso,
        tone: e.failed ? 'danger' : 'neutral',
        icon: <EventIcon kind={e.kind} />,
        detail: e.comment,
      }))}
    />
  )
}

Props

PropTypeDefaultWhat it does
items{ id?, actor?: ReactNode, title: ReactNode, time?: string, dateTime?: string, description?: ReactNode, detail?: ReactNode, icon?: ReactNode, tone?: 'accent' | 'success' | 'warning' | 'danger' | 'neutral' }[]—Entries, newest first or oldest first as you like. actor is set in ink before the title; detail adds a show/hide button and opens in a soft panel; tone colours the marker.
variant'icon' | 'dot''icon'A 30px tinted disc with the item's icon, or a small ringed dot.
density'comfortable' | 'compact''comfortable'22px or 12px between entries.
defaultOpen(string | number)[][]Ids (or indexes) of entries whose detail starts open.
label / labelsstring / { show, hide }'Activity'Accessible name of the list, and the text of the detail button.

Accessibility

  • The timeline is an ordered list with an accessible name; markers and the rail are hidden from screen readers.
  • Times use the time element with an optional machine-readable dateTime.
  • Each detail button reports aria-expanded and points at its panel with aria-controls; a closed panel is inert, so its content is skipped by Tab and screen readers.
  • Reduced motion removes the rise and the rail draw; details only fade.

Motion

Entries: 560ms rise with a 70ms stagger on the reveal curve; rails draw 160ms later. Details: 360ms row expansion.

Add it to your project

Copy the prompt into Codex or Claude Code. The agent reads the published source, shows you what it will write and adds the component next to your own.

Timeline.jsxtimeline.csstokens.cssREADME.md

Both files install together. The stylesheet reads the design tokens in tokens.css and carries fallbacks, so it also works alone.

Data display
Code diff comes with Pro. Its preview shows once you unlock it.
Flip countdown comes with Pro. Its preview shows once you unlock it.