Skip to content

Components · Collaboration

ActivityTimeline

Vertical feed of events: actor, verb, object, time and marker, grouped by day, with expandable details and filters.

@rookcom/monarch-react/collaborationComponent

Task activity with filters and details

Today

  1. Ana Lopez moved Pricing page refresh to In review

    Mar 2, 2026, 11:20 AM
    Status
    In progress → In review
    Reviewer
    None → Ben Okafor
  2. Ben Okafor commented

    Mar 2, 2026, 10:05 AM
    Copy looks good. Can we swap the hero image for the lighter one?
  3. Auto-assign rule assigned Chloé Martin

    Mar 2, 2026, 8:30 AMAutomatedRule: Round robin

Yesterday

  1. Dev Patel created this task

    Mar 1, 2026, 4:45 PM

Usage examples

Compact, with avatars

Purpose

Tells the story of a record or a workspace as a readable list of sentences (“Ana Lopez moved Pricing page to In review”), with who did it, when, and optional details. One shared pattern, so every product’s history reads the same way.

Use when

  • A record’s history: a ticket, task, client, incident or IP record.
  • Project or workspace activity, with comments and changes interleaved.
  • Status-page incident updates (a stage per event, automated updates tagged).

Avoid when

  • A live conversation with replies and reactions: use MessageTimeline and MessageRow.
  • A security audit trail that needs IP, device and export: use AuditLogViewer.
  • Unread inbox items: use NotificationCenter.

Design principles

  • Events read as sentences: actor in strong text, then the verb, then the object.
  • People and automation are always distinguishable: automation and system actors carry an “Automated” tag in text.
  • Detail on demand: diffs and payloads sit behind a disclosure, so the feed stays scannable.
  • The product humanises events; Monarch lays them out. Verbs and objects are nodes the product writes.

API reference

import { ActivityTimeline } from '@rookcom/monarch-react/collaboration';
ExportKindRenderingRoot class
ActivityTimelinecomponentclient.mn-activity-timeline

Each event: id, verb, time, and optional actor, object, icon, tone, meta, body, details.

expandedIds / defaultExpandedIds / onExpandedChange control the open details.

The ref is forwarded to the root <div>.

Generated from the TypeScript declarations of packages/react/src/components/collaboration/activity-timeline.

Properties

ActivityTimeline

A vertical feed of events: actor, verb, object, time and a marker, grouped by day, with expandable details, a filter slot and load more. For record histories, audit trails in context and project activity.

PropTypeDescription
events requiredreadonly ActivityEvent[]Events, newest first (or oldest first: order is kept).
classNamestring
dayHeadingLevel"h2" | "h3" | "h4" | "h5" | "h6"Heading level of the day labels. Default `h3`.
defaultExpandedIdsreadonly string[]
density"default" | "compact"`compact` tightens spacing for side panels.
emptyReactNodeReplaces the default empty text.
errorReactNodeFailure, e.g. an InlineErrorRetry. Replaces the feed.
expandedIdsreadonly string[]Open details, controlled.
filtersReactNodeFilter controls above the feed (TabsFilter, FilterBar, a Select). The product filters `events`.
groupByDaybooleanGroup under Today, Yesterday and dates. Default `true`.
hasMorebooleanAnother page exists. Shows LoadMore after the feed.
idstring
loadingbooleanFirst load: shows a skeleton.
loadingMoreboolean
loadMoreErrorboolean
localestring
markers"dot" | "avatar"`dot` (default) or the actor's `avatar` as the marker.
messagesPartial<ActivityTimelineMessages>
nowDateInput
onExpandedChange((ids: string[]) => void)
onLoadMore(() => void)
timeZonestring

Variants

PropValuesDescription
markers'dot''avatar'Tone-coloured dots, or the actor’s avatar. An event icon wins over both.
density'default''compact'Compact for side panels.
groupByDay'true''false'Day headings, or one ordered list.
ActivityEvent.tone'neutral''accent''info''success''warning''danger'Marker colour for stages such as resolved or failed. Never the only signal: say it in the verb too.

States

StateExposed asBehaviour
Loading–Skeleton rows.
Empty–“No activity yet”, or the empty node.
Error–The error node replaces the feed.
Details open–The toggle reads “Hide details” with aria-expanded="true".
More to load–LoadMore after the feed.

Interaction behaviour

  • “Show details” toggles the event’s details; onExpandedChange reports the open ids.
  • Filters are the product’s: put controls in filters and pass the filtered events.
  • LoadMore calls onLoadMore and announces the new events.
  • Timestamps show the absolute time on hover and focus (RelativeTime).

Keyboard support

KeysAction
TabMoves through filters, links in events, timestamps, detail toggles and Load more.
Enter / SpaceToggles details on a “Show details” button.
EscapeOn a focused timestamp, hides its tooltip.

Accessibility

Role
ordered lists (one per day) labelled by their day heading
Accessible name
Each day list is labelled by its heading; an ungrouped list by aria-label (default “Activity”).
  • Markers and icons are decorative (aria-hidden); the sentence carries the meaning.
  • Times are <time datetime> with the absolute time in a tooltip on focus.
  • Detail toggles use aria-expanded and aria-controls.
  • Day headings default to h3; set dayHeadingLevel to fit the page outline.

Responsive behaviour

  • Sentences wrap; long objects break; filters wrap onto several lines.
  • Nothing is hidden on narrow screens.

Theme support

  • The connector is border-subtle; dot tones use the status solids; bodies use a bg-surface card and details a bg-subtle panel.
  • Forced colours draw markers and the connector in CanvasText.

Do and don't

Do

  • Write verbs in the past tense and objects as links where they lead somewhere.
  • Set actor.kind for rules, imports and integrations.
  • Use details for field diffs and payloads; keep the sentence short.

Don't

  • Do not rely on marker colour alone for meaning.
  • Do not put raw JSON in the sentence.
  • Do not use it for chat: replies, reactions and grouping belong to MessageRow.

Dependencies

KindDepends on
npm packagesreact
Monarch componentsAvatar, RelativeTime, LoadMore, Skeleton

Testing coverage

  • Ordered list per day labelled by its heading, with the actor-verb-object sentence and <time datetime>.
  • Tags automation actors.
  • Details disclosure by keyboard, uncontrolled and controlled.
  • Filter slot, ungrouped list and avatar markers with a dot fallback.
  • Loading, empty, error and load more; heading level, density and translations.
CheckCovered
Axe in jsdomYes
Server renderingYes
Browser suitesVisual baselines: /__gallery/activity-timeline; Cross-browser axe: /components/activity-timeline

Tests: packages/react/src/components/collaboration/activity-timeline