# Activity timeline

A semantic grouped timeline with native times, consumer-owned activity, and controlled detail disclosures.

Access: pro. Category: Data. Kind: composite.

## When to use

- Use it when a page needs a semantic grouped timeline with native times, consumer-owned activity, and controlled detail disclosures.
- Choose it when the data structure, labels, and state are supplied by the application and must remain consumer controlled.

## Alternatives

- Choose data-table instead when sortable column controls, native row selection and a scrollable table is the actual interface need, rather than activity timeline.

## Setup for agents

Use React 19 and TypeScript. Initialize shadcn for your framework, then merge this exact entry into components.json:

```json
{
  "registries": {
    "@tidal-pro": {
      "url": "https://tidalui.com/r/pro/{name}.json",
      "headers": {
        "Authorization": "Bearer ${TIDALUI_TOKEN}"
      }
    }
  }
}
```

The namespace must be named **@tidal-pro** because transitive Pro dependencies use that namespace. Obtain an agent key from your active Pro account at https://tidalui.com/account. Keep TIDALUI_TOKEN in your local environment, never in components.json, client code, Git or logs.

```sh
export TIDALUI_TOKEN='your-private-agent-key'
npx shadcn@latest add @tidal-pro/waitlist-form
npx shadcn@latest add https://tidalui.com/r/tidal-button.json
```

Free command: `npx shadcn@latest add https://tidalui.com/r/<name>.json`.
Pro command: `npx shadcn@latest add @tidal-pro/<name>`.

Import the base stylesheet and every stylesheet listed on the installed item's metadata. For example:

```tsx
import "./components/ui/tidal.css";
import "./components/ui/hero-section.css";
// Place installed components inside this wrapper:
<div className="tidal-scope" data-theme="dark">...</div>
```

Omit data-theme for the default light theme. Put the attribute on the same tidal-scope element for dark mode. Every component installs the shared free tidal-base dependency. After upgrading, run `npx shadcn@latest add https://tidalui.com/r/tidal-base.json --overwrite` to receive current tokens. Review local modifications before overwriting.

Vite: Use React + TypeScript. Map @/* to ./src/* in paths and Vite resolve.alias. Import tidal.css and each component stylesheet in your application entry.

Next.js 15 App Router: Next.js App Router: import tidal.css and component CSS in app/layout.tsx. Interactive examples belong in a client component with "use client". Map @/* to ./* or ./src/* to match your project.

TypeScript 6: use paths without baseUrl:

```json
{
  "compilerOptions": {
    "paths": {
      "@/*": [
        "./src/*"
      ]
    }
  }
}
```

Pro registry requests are server/CLI-only. Use the same-origin account interface in a browser; cross-origin Authorization preflights are intentionally unsupported.


## Install Activity timeline

```sh
npx shadcn@latest add @tidal-pro/activity-timeline
```

Stylesheets: `components/ui/tidal.css`, `components/ui/activity-timeline.css`.

## Minimal example

```tsx
import"./components/ui/tidal.css";
import"./components/ui/activity-timeline.css";
import{TidalActivityTimeline}from"./components/ui/activity-timeline";
export default()=><div className="tidal-scope"><TidalActivityTimeline groups={[{id:"example",label:"Demo",events:[{id:"example",dateTime:"2026-01-01",timeLabel:"Demo",title:"Demo"}]}]} title={"Demo"}/></div>;
```

## Structured props

- `TidalActivityTimeline.groups: ReadonlyArray<TidalActivityGroup>`: Required groups value accepted by this exported component.
- `TidalActivityTimeline.title: ReactNode`: Required title value accepted by this exported component.
- `TidalActivityTimeline.description?: ReactNode`: Optional description value accepted by this exported component.
- `TidalActivityTimeline.emptyMessage?: ReactNode` (default "No activity to display."): Optional empty message value accepted by this exported component.
- `TidalActivityTimeline.expandedIds?: ReadonlySet<string> | undefined` (default new Set<string>()): Controlled IDs for collapsible details. Omit the callback to render every detail statically.
- `TidalActivityTimeline.eyebrow?: ReactNode` (default "Activity"): Optional eyebrow value accepted by this exported component.
- `TidalActivityTimeline.groupHeadingLevel?: TidalActivityGroupHeadingLevel | undefined`: Optional group heading level value accepted by this exported component.
- `TidalActivityTimeline.headingLevel?: TidalActivityHeadingLevel | undefined` (default "h2"): Optional heading level value accepted by this exported component.
- `TidalActivityTimeline.labels?: TidalActivityLabels | undefined`: Optional labels value accepted by this exported component.
- `TidalActivityTimeline.onExpandedChange?: ((eventId: string, expanded: boolean) => void) | undefined`: Callback invoked when the expanded change interaction is proposed.

## Complete usage example

[Source](https://tidalui.com/examples/activity-timeline.tsx) | [Manifest](https://tidalui.com/examples/activity-timeline.json). Install the listed additional dependencies. Consumer fixture: TypeScript pass; Vite pass. This fixture check is distinct from the actual shadcn install receipt.

```tsx
"use client";

import "./components/ui/tidal.css";

import { useMemo, useState } from "react";

import { CalendarClock, Check, Download, FileText, MessageSquareText } from "lucide-react";

import { TidalActivityTimeline, type TidalActivityEvent, type TidalActivityGroup } from "./components/ui/activity-timeline";

import "./components/ui/activity-timeline.css";

function tidalExampleAvatarDataUri(seed: unknown) {
  const text = String(seed).replace(/[^a-z0-9]/gi, "").slice(-2) || "UI";
  const palette = ["#333333", "#555555", "#777777", "#999999", "#bbbbbb"];
  const color = palette[Array.from(text).reduce((sum, character) => sum + character.charCodeAt(0), 0) % palette.length];
  const svg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96"><rect width="96" height="96" rx="48" fill="${color}"/><circle cx="48" cy="38" r="17" fill="white" fill-opacity=".92"/><path d="M18 92c3-22 15-34 30-34s27 12 30 34" fill="white" fill-opacity=".92"/></svg>`;
  return `data:image/svg+xml,${encodeURIComponent(svg)}`;
}

function tidalExampleImageDataUri(label: string) {
  const safeLabel = label.replace(/[<>&]/g, "").slice(0, 28) || "Sample image";
  const svg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 675"><defs><linearGradient id="g" x1="0" x2="1" y1="0" y2="1"><stop stop-color="#171717"/><stop offset="1" stop-color="#555555"/></linearGradient></defs><rect width="1200" height="675" fill="url(#g)"/><circle cx="950" cy="100" r="260" fill="white" fill-opacity=".08"/><text x="80" y="570" fill="white" font-family="system-ui,sans-serif" font-size="64" font-weight="700">${safeLabel}</text></svg>`;
  return `data:image/svg+xml,${encodeURIComponent(svg)}`;
}

const tidalExampleStyles = ".tidal-scope .activity-timeline-demo {\n  display: grid;\n  grid-template-columns: minmax(0, 1fr);\n  width: 100%;\n  max-width: 1120px;\n  min-width: 0;\n  overflow: hidden;\n  border: 1px solid var(--t-border);\n  border-radius: var(--t-radius-card);\n  background: var(--t-subtle);\n  color: var(--t-ink);\n  box-shadow: 0 28px 58px -46px #00000075;\n  container-type: inline-size;\n}\n\n.tidal-scope .activity-timeline-demo,\n.tidal-scope .activity-timeline-demo * {\n  box-sizing: border-box;\n}\n\n.tidal-scope .activity-demo-stage {\n  min-width: 0;\n  padding: 27px;\n  background:\n    linear-gradient(var(--t-border) 1px, transparent 1px),\n    linear-gradient(90deg, var(--t-border) 1px, transparent 1px),\n    color-mix(in srgb, var(--t-surface) 76%, var(--t-subtle));\n  background-size: 24px 24px;\n}\n\n.tidal-scope .activity-demo-filters {\n  display: grid;\n  grid-template-columns: repeat(4, minmax(0, 1fr));\n  gap: 6px;\n  margin-bottom: 23px;\n}\n\n.tidal-scope .activity-demo-filters button {\n  min-width: 44px;\n  min-height: 44px;\n  padding: 8px 10px;\n  border: 1px solid var(--t-border);\n  border-radius: var(--t-radius-control);\n  background: var(--t-surface);\n  color: var(--t-muted);\n  font: inherit;\n  font-size: 11px;\n  font-weight: 600;\n  cursor: pointer;\n  transition:\n    background 160ms,\n    color 160ms,\n    border-color 160ms,\n    transform 140ms var(--t-ease-out);\n}\n\n.tidal-scope .activity-demo-filters button[aria-pressed=\"true\"] {\n  border-color: var(--t-ink);\n  background: var(--t-ink);\n  color: var(--t-surface);\n}\n\n.tidal-scope .activity-demo-filters button:hover {\n  border-color: var(--t-ink);\n}\n\n.tidal-scope .activity-demo-filters button:active {\n  transform: scale(0.98);\n}\n\n.tidal-scope .activity-demo-filters button:focus-visible {\n  outline: 2px solid var(--t-accent);\n  outline-offset: 3px;\n}\n\n.tidal-scope .activity-demo-stage > .tidal-activity {\n  max-width: none;\n}\n\n.tidal-scope .activity-demo-status {\n  min-height: 17px;\n  margin: 17px 0 0;\n  color: var(--t-muted);\n  font-size: 11px;\n  line-height: 1.6;\n  overflow-wrap: anywhere;\n}\n\n.tidal-scope .activity-demo-checklist > strong {\n  color: var(--t-ink);\n  font-size: 11px;\n}\n\n.tidal-scope .activity-demo-checklist ul,\n.tidal-scope .activity-demo-notes {\n  display: grid;\n  gap: 5px;\n  margin: 8px 0 0;\n  padding-inline-start: 17px;\n}\n\n.tidal-scope .activity-demo-file {\n  display: flex;\n  min-width: 0;\n  align-items: center;\n  justify-content: space-between;\n  gap: 12px;\n}\n\n.tidal-scope .activity-demo-file > span,\n.tidal-scope .activity-demo-file > a {\n  display: flex;\n  min-width: 0;\n  align-items: center;\n  gap: 8px;\n}\n\n.tidal-scope .activity-demo-file strong,\n.tidal-scope .activity-demo-file small {\n  display: block;\n  overflow-wrap: anywhere;\n}\n\n.tidal-scope .activity-demo-file strong {\n  color: var(--t-ink);\n  font-size: 11px;\n}\n\n.tidal-scope .activity-demo-file small {\n  margin-top: 2px;\n  color: var(--t-muted);\n  font-size: 11px;\n}\n\n.tidal-scope .activity-demo-file > a {\n  min-width: 44px;\n  min-height: 44px;\n  flex: none;\n  justify-content: center;\n  padding: 8px 10px;\n  border: 1px solid var(--t-border);\n  border-radius: 8px;\n  color: var(--t-ink);\n  font-size: 11px;\n  font-weight: 650;\n  text-decoration: none;\n}\n\n.tidal-scope .activity-demo-file > a:focus-visible {\n  outline: 2px solid var(--t-accent);\n  outline-offset: 3px;\n}\n\n.tidal-scope .activity-demo-change {\n  display: grid;\n  grid-template-columns: repeat(2, minmax(0, 1fr));\n  gap: 8px;\n  margin: 0;\n}\n\n.tidal-scope .activity-demo-change > div {\n  padding: 9px;\n  border: 1px solid var(--t-border);\n  border-radius: 8px;\n  background: var(--t-surface);\n}\n\n.tidal-scope .activity-demo-change dt {\n  color: var(--t-muted);\n  font-size: 11px;\n  text-transform: uppercase;\n}\n\n.tidal-scope .activity-demo-change dd {\n  margin: 4px 0 0;\n  color: var(--t-ink);\n  font-size: 11px;\n  font-weight: 650;\n}\n\n@container (max-width: 760px) {\n  .tidal-scope .activity-timeline-demo {\n    grid-template-columns: minmax(0, 1fr);\n  }\n}\n\n@container (max-width: 500px) {\n\n  .tidal-scope .activity-demo-stage {\n    padding: 14px;\n    background-size: 18px 18px;\n  }\n\n  .tidal-scope .activity-demo-filters {\n    grid-template-columns: repeat(2, minmax(0, 1fr));\n  }\n\n  .tidal-scope .activity-demo-file {\n    align-items: stretch;\n    flex-direction: column;\n  }\n\n  .tidal-scope .activity-demo-file > a {\n    width: 100%;\n  }\n}\n\n@media (prefers-reduced-motion: reduce) {\n  .tidal-scope .activity-demo-filters button {\n    transition: none;\n    transform: none;\n  }\n}";

type ActivityKind = "decision" | "file" | "note";

interface SampleEvent extends TidalActivityEvent {
  kind: ActivityKind;
  plainTitle: string;
}

interface SampleGroup extends Omit<TidalActivityGroup, "events"> {
  events: readonly SampleEvent[];
}

const FILTERS: readonly { id: "all" | ActivityKind; label: string }[] = [
  { id: "all", label: "All updates" },
  { id: "decision", label: "Decisions" },
  { id: "file", label: "Files" },
  { id: "note", label: "Notes" },
];

const SAMPLE_GROUPS: readonly SampleGroup[] = [
  {
    id: "today",
    label: "Today",
    events: [
      {
        id: "launch-checklist",
        kind: "decision",
        plainTitle: "Approved the launch checklist",
        dateTime: "2026-10-14T10:42:00-05:00",
        timeLabel: "10:42 AM",
        title: "Approved the launch checklist",
        description:
          "All eight sample tasks are marked ready for the local release plan.",
        marker: <Check />,
        meta: "Decision",
        actor: {
          name: "Mila Santos",
          detail: "Sample project lead",
          portrait: (
            <img src={tidalExampleAvatarDataUri("03")} alt="" loading="lazy" />
          ),
        },
        details: (
          <div className="activity-demo-checklist">
            <strong>Approved items</strong>
            <ul>
              <li>Final copy reviewed</li>
              <li>Keyboard paths checked</li>
              <li>Sample files confirmed</li>
            </ul>
          </div>
        ),
      },
      {
        id: "project-brief",
        kind: "file",
        plainTitle: "Uploaded project brief v3",
        dateTime: "2026-10-14T09:18:00-05:00",
        timeLabel: "9:18 AM",
        title: "Uploaded project brief v3",
        description:
          "Replaced the fictional project outline with the reviewed sample copy.",
        marker: <FileText />,
        meta: "Text file",
        actor: {
          name: "Noah Price",
          detail: "Sample editor",
          portrait: (
            <img src={tidalExampleAvatarDataUri("02")} alt="" loading="lazy" />
          ),
        },
        details: (
          <div className="activity-demo-file">
            <span>
              <FileText size={15} aria-hidden="true" />
              <span>
                <strong>sample-project-brief.txt</strong>
                <small>Local fictional document</small>
              </span>
            </span>
            <a href="/sample-project-brief.txt" download>
              <Download size={14} aria-hidden="true" />
              Download sample
            </a>
          </div>
        ),
      },
    ],
  },
  {
    id: "yesterday",
    label: "Yesterday",
    events: [
      {
        id: "kickoff-date",
        kind: "decision",
        plainTitle: "Moved the sample kickoff to October 19",
        dateTime: "2026-10-13T15:26:00-05:00",
        timeLabel: "3:26 PM",
        title: "Moved the sample kickoff to October 19",
        description:
          "The connected preview now reflects the revised fictional schedule.",
        marker: <CalendarClock />,
        meta: "Schedule",
        actor: {
          name: "Ava Singh",
          detail: "Sample coordinator",
          portrait: (
            <img src={tidalExampleAvatarDataUri("01")} alt="" loading="lazy" />
          ),
        },
        details: (
          <dl className="activity-demo-change">
            <div>
              <dt>Previous</dt>
              <dd>October 17</dd>
            </div>
            <div>
              <dt>Updated</dt>
              <dd>October 19</dd>
            </div>
          </dl>
        ),
      },
      {
        id: "review-notes",
        kind: "note",
        plainTitle: "Added three review notes",
        dateTime: "2026-10-13T11:05:00-05:00",
        timeLabel: "11:05 AM",
        title: "Added three review notes",
        description:
          "The notes identify copy, spacing, and keyboard checks in this local sample.",
        marker: <MessageSquareText />,
        meta: "3 notes",
        actor: {
          name: "Mila Santos",
          detail: "Sample project lead",
          portrait: (
            <img src={tidalExampleAvatarDataUri("03")} alt="" loading="lazy" />
          ),
        },
        details: (
          <ol className="activity-demo-notes">
            <li>Clarify the empty-state copy.</li>
            <li>Keep all controls at least 44 pixels.</li>
            <li>Confirm the reduced-motion final state.</li>
          </ol>
        ),
      },
    ],
  },
];

function findSampleEvent(id: string) {
  return SAMPLE_GROUPS.flatMap((group) => group.events).find(
    (event) => event.id === id,
  );
}

export function ActivityTimelineDemo() {
  const [filter, setFilter] = useState<(typeof FILTERS)[number]["id"]>("all");
  const [expandedIds, setExpandedIds] = useState<ReadonlySet<string>>(
    () => new Set(["launch-checklist"]),
  );
  const [status, setStatus] = useState(
    "Showing all four fictional project updates.",
  );

  const visibleGroups = useMemo(
    () =>
      SAMPLE_GROUPS.map((group) => ({
        ...group,
        events:
          filter === "all"
            ? group.events
            : group.events.filter((event) => event.kind === filter),
      })),
    [filter],
  );
  function chooseFilter(nextFilter: (typeof FILTERS)[number]["id"]) {
    setFilter(nextFilter);
    const label = FILTERS.find((item) => item.id === nextFilter)?.label;
    const nextCount = SAMPLE_GROUPS.reduce(
      (count, group) =>
        count +
        group.events.filter(
          (event) => nextFilter === "all" || event.kind === nextFilter,
        ).length,
      0,
    );
    setStatus(
      `${label} selected. ${nextCount} fictional update${nextCount === 1 ? "" : "s"} shown.`,
    );
  }

  function toggleEvent(eventId: string, expanded: boolean) {
    setExpandedIds((current) => {
      const next = new Set(current);
      if (expanded) next.add(eventId);
      else next.delete(eventId);
      return next;
    });
    const event = findSampleEvent(eventId);
    setStatus(
      `${expanded ? "Opened" : "Closed"} details for ${event?.plainTitle ?? "the update"}.`,
    );
  }

  return (
    <section
      className="activity-timeline-demo"
      aria-label="Activity timeline preview"
    >
      <div className="activity-demo-stage">
        <div
          className="activity-demo-filters"
          role="group"
          aria-label="Filter project activity"
        >
          {FILTERS.map((item) => (
            <button
              key={item.id}
              type="button"
              aria-pressed={filter === item.id}
              onClick={() => chooseFilter(item.id)}
            >
              {item.label}
            </button>
          ))}
        </div>

        <TidalActivityTimeline
          eyebrow="Recent updates"
          title="Project activity"
          description="Decisions, files, and review notes from a fictional workspace. Nothing is synced or sent."
          groups={visibleGroups}
          expandedIds={expandedIds}
          onExpandedChange={toggleEvent}
        />

        <p className="activity-demo-status" aria-live="polite">
          {status}
        </p>
      </div>
    </section>
  );
}

export default function AgentExample() {
  return (
    <div className="tidal-scope" data-theme="light" dir="ltr">
      <style>{tidalExampleStyles}</style>
      <ActivityTimelineDemo />
    </div>
  );
}

```

## Gotchas

- The host application owns data, validation, persistence, navigation, and service side effects described by this API.

## Theme and accessibility

{"tokens":["--t-accent","--t-border","--t-border-strong","--t-canvas","--t-danger","--t-display","--t-ease-out","--t-ease-spring","--t-faint","--t-font","--t-ink","--t-line","--t-muted","--t-primary","--t-primary-contrast","--t-radius-card","--t-radius-control","--t-radius-overlay","--t-radius-panel","--t-ring","--t-shadow-lg","--t-shadow-soft","--t-soft","--t-subtle","--t-surface","--t-wash"],"darkMode":true}

{"keyboard":["Tab and Shift+Tab follow the component's native focus order."],"aria":"The component wires labels and relationships from consumer-provided visible text or ARIA props; preserve those labels in production.","notes":"Verify focus visibility, text alternatives, contrast, and reduced motion in the final composition."}

Required title and groups of uniquely identified consumer-owned events. Each event requires id, dateTime, timeLabel and title; optional description, actor, decorative marker, meta and details. headingLevel: h2(default) | h3 | h4. groupHeadingLevel: h3 | h4 | h5 and defaults one level below the selected section heading. expandedIds and onExpandedChange form the controlled disclosure contract; when no callback is supplied, event details render statically without a fake control. labels localizes Show details and Hide details. emptyMessage accepts caller-owned content. The section forwards native attributes/ref and optional aria-labelledby/aria-describedby. Events render as grouped ol/li/article structures with native time elements, 44px disclosure controls, inert collapsed content, logical RTL geometry, finite entrance/detail motion and a static reduced-motion state. The component performs no requests, storage, timers, routing, analytics or event mutation.
