# Activity feed

A compact grouped activity inbox with controlled filters, unread states, native destinations and actions.

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

## When to use

- Use it when a page needs a compact grouped activity inbox with controlled filters, unread states, native destinations and actions.
- 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 feed.

## 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 feed

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

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

## Minimal example

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

## Structured props

- `TidalActivityFeed.groups: ReadonlyArray<TidalActivityFeedGroup>`: Required groups value accepted by this exported component.
- `TidalActivityFeed.title: ReactNode`: Required title value accepted by this exported component.
- `TidalActivityFeed.description?: ReactNode`: Optional description value accepted by this exported component.
- `TidalActivityFeed.emptyMessage?: ReactNode` (default "No activity matches this view."): Optional empty message value accepted by this exported component.
- `TidalActivityFeed.eyebrow?: ReactNode`: Optional eyebrow value accepted by this exported component.
- `TidalActivityFeed.filter?: TidalActivityFeedFilter | undefined`: Optional filter value accepted by this exported component.
- `TidalActivityFeed.footer?: ReactNode`: Optional footer value accepted by this exported component.
- `TidalActivityFeed.groupHeadingLevel?: "h3" | "h4" | "h5" | undefined`: Optional group heading level value accepted by this exported component.
- `TidalActivityFeed.headingLevel?: "h2" | "h3" | "h4" | undefined` (default "h2"): Optional heading level value accepted by this exported component.
- `TidalActivityFeed.labels?: Partial<TidalActivityFeedLabels> | undefined`: Optional labels value accepted by this exported component.

## Complete usage example

[Source](https://tidalui.com/examples/activity-feed.tsx) | [Manifest](https://tidalui.com/examples/activity-feed.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 { useCallback, useId, useLayoutEffect, useMemo, useRef, useState } from "react";

import { TidalActivityFeed, type TidalActivityFeedGroup, type TidalActivityFeedItem } from "./components/ui/activity-feed";

import "./components/ui/activity-feed.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-feed-demo,\n.tidal-scope .activity-feed-demo * {\n  box-sizing: border-box;\n}\n\n.tidal-scope .activity-feed-demo {\n  width: 100%;\n  min-width: 0;\n  border: 1px solid var(--t-border);\n  border-radius: 22px;\n  background: var(--t-subtle);\n  color: var(--t-ink);\n  container: activity-feed-demo / inline-size;\n}\n\n.tidal-scope .activity-feed-demo-layout {\n  display: grid;\n  min-width: 0;\n  grid-template-columns: minmax(0, 1fr) minmax(250px, 0.42fr);\n  gap: 14px;\n  padding: 20px;\n}\n\n.tidal-scope .activity-feed-demo-detail {\n  position: sticky;\n  top: 14px;\n  min-width: 0;\n  min-height: 360px;\n  align-self: start;\n  padding: 24px;\n  border: 1px solid var(--t-border);\n  border-radius: 18px;\n  background: var(--t-ink);\n  color: var(--t-surface);\n  outline: none;\n}\n\n.tidal-scope .activity-feed-demo-detail:focus-visible {\n  outline: 2px solid var(--t-accent);\n  outline-offset: 3px;\n}\n\n.tidal-scope .activity-feed-demo-detail > span {\n  color: color-mix(in srgb, var(--t-surface) 62%, var(--t-ink));\n  font-size: 11px;\n  font-weight: 700;\n  letter-spacing: 0.1em;\n  line-height: 1.35;\n  text-transform: uppercase;\n}\n\n.tidal-scope .activity-feed-demo-detail-topline {\n  display: flex;\n  min-width: 0;\n  align-items: center;\n  justify-content: space-between;\n  gap: 10px;\n  margin-top: 22px;\n  padding-bottom: 12px;\n  border-bottom: 1px solid\n    color-mix(in srgb, var(--t-surface) 24%, var(--t-ink));\n  color: color-mix(in srgb, var(--t-surface) 68%, var(--t-ink));\n  font-size: 11px;\n  line-height: 1.35;\n}\n\n.tidal-scope .activity-feed-demo-detail-topline strong,\n.tidal-scope .activity-feed-demo-detail-topline time {\n  min-width: 0;\n  overflow-wrap: anywhere;\n}\n\n.tidal-scope .activity-feed-demo-detail h3 {\n  margin: 25px 0 0;\n  font-size: clamp(25px, 5cqi, 38px);\n  font-weight: 530;\n  letter-spacing: -0.052em;\n  line-height: 1.03;\n  text-wrap: balance;\n  overflow-wrap: anywhere;\n}\n\n.tidal-scope .activity-feed-demo-detail p {\n  margin: 15px 0 0;\n  color: color-mix(in srgb, var(--t-surface) 72%, var(--t-ink));\n  font-size: 11px;\n  line-height: 1.65;\n  overflow-wrap: anywhere;\n}\n\n.tidal-scope .activity-feed-demo-detail dl {\n  display: grid;\n  gap: 1px;\n  margin: 23px 0 0;\n  overflow: hidden;\n  border: 1px solid color-mix(in srgb, var(--t-surface) 22%, var(--t-ink));\n  border-radius: 10px;\n  background: color-mix(in srgb, var(--t-surface) 22%, var(--t-ink));\n}\n\n.tidal-scope .activity-feed-demo-detail dl > div {\n  min-width: 0;\n  padding: 10px 11px;\n  background: var(--t-ink);\n}\n\n.tidal-scope .activity-feed-demo-detail dt {\n  color: color-mix(in srgb, var(--t-surface) 58%, var(--t-ink));\n  font-size: 11px;\n  line-height: 1.35;\n}\n\n.tidal-scope .activity-feed-demo-detail dd {\n  margin: 4px 0 0;\n  font-size: 11px;\n  line-height: 1.4;\n  overflow-wrap: anywhere;\n}\n\n@container activity-feed-demo (max-width: 760px) {\n  .tidal-scope .activity-feed-demo-layout {\n    grid-template-columns: minmax(0, 1fr);\n    padding: 10px;\n  }\n\n  .tidal-scope .activity-feed-demo-detail {\n    position: static;\n    min-height: 0;\n  }\n}\n\n@container activity-feed-demo (max-width: 390px) {\n  .tidal-scope .activity-feed-demo-layout {\n    gap: 9px;\n    padding: 7px;\n  }\n\n  .tidal-scope .activity-feed-demo-detail {\n    padding: 20px 16px;\n  }\n}";

type FilterId = "all" | "unread" | "comment" | "change";

type SampleItem = Omit<TidalActivityFeedItem, "destination" | "actions"> & {
  groupId: "today" | "earlier";
  kind: Exclude<FilterId, "all" | "unread">;
  detail: string;
};

const INITIAL_ITEMS: readonly SampleItem[] = [
  {
    id: "brief-comment",
    groupId: "today",
    kind: "comment",
    title: "Ava left a note on the sample brief",
    dateTime: "2026-10-14T09:24:00-05:00",
    timeLabel: "9:24 AM",
    description:
      "The local note asks whether the launch checklist should appear beside the brief.",
    category: "Comment",
    context: "Project brief",
    unread: true,
    actor: {
      name: "Ava Stone",
      detail: "Fictional teammate",
      avatarSrc: tidalExampleAvatarDataUri("01"),
    },
    detail:
      "Ava’s fictional note suggests placing the checklist beside the project brief so both sample files can be reviewed together.",
  },
  {
    id: "milestone-change",
    groupId: "today",
    kind: "change",
    title: "Noah moved the review milestone",
    dateTime: "2026-10-14T08:10:00-05:00",
    timeLabel: "8:10 AM",
    description:
      "The fictional due label changed from Wednesday to Friday in local sample data.",
    category: "Change",
    context: "Launch plan",
    unread: true,
    actor: {
      name: "Noah Park",
      detail: "Fictional teammate",
      avatarSrc: tidalExampleAvatarDataUri("02"),
    },
    detail:
      "The sample milestone now reads Friday. No calendar event, task, or remote record was changed.",
  },
  {
    id: "checklist-comment",
    groupId: "today",
    kind: "comment",
    title: "Mila answered the checklist question",
    dateTime: "2026-10-14T07:42:00-05:00",
    timeLabel: "7:42 AM",
    description:
      "The answer references the fictional launch checklist included with this preview.",
    category: "Comment",
    context: "Checklist",
    unread: false,
    actor: {
      name: "Mila Santos",
      detail: "Fictional teammate",
      avatarSrc: tidalExampleAvatarDataUri("03"),
    },
    detail:
      "Mila’s sample answer confirms that every checklist item remains visible in the local document example.",
  },
  {
    id: "status-change",
    groupId: "earlier",
    kind: "change",
    title: "Eli changed the sample status to review",
    dateTime: "2026-10-13T16:18:00-05:00",
    timeLabel: "Yesterday",
    description:
      "The status word updates only this fictional feed and its local detail panel.",
    category: "Change",
    context: "Workspace sample",
    unread: false,
    actor: {
      name: "Eli Brooks",
      detail: "Fictional teammate",
      avatarSrc: tidalExampleAvatarDataUri("04"),
    },
    detail:
      "The fictional workspace status is Review. This preview has no connected workspace, account, or backend.",
  },
];

export function ActivityFeedDemo() {
  const generatedId = useId().replace(/:/g, "");
  const detailId = `activity-feed-${generatedId}-detail`;
  const [filter, setFilter] = useState<FilterId>("all");
  const [items, setItems] = useState(INITIAL_ITEMS);
  const [selectedId, setSelectedId] = useState(INITIAL_ITEMS[0].id);
  const [message, setMessage] = useState(
    "Choose an activity title or filter. All changes stay in local preview state.",
  );
  const filterNodes = useRef(new Map<FilterId, HTMLButtonElement>());
  const pendingFilterFocus = useRef<FilterId | null>(null);
  const allFilterRef = useCallback((node: HTMLButtonElement | null) => {
    if (node) filterNodes.current.set("all", node);
    else filterNodes.current.delete("all");
  }, []);
  const unreadFilterRef = useCallback((node: HTMLButtonElement | null) => {
    if (node) filterNodes.current.set("unread", node);
    else filterNodes.current.delete("unread");
  }, []);
  const commentFilterRef = useCallback((node: HTMLButtonElement | null) => {
    if (node) filterNodes.current.set("comment", node);
    else filterNodes.current.delete("comment");
  }, []);
  const changeFilterRef = useCallback((node: HTMLButtonElement | null) => {
    if (node) filterNodes.current.set("change", node);
    else filterNodes.current.delete("change");
  }, []);

  useLayoutEffect(() => {
    const target = pendingFilterFocus.current;
    if (!target) return;
    pendingFilterFocus.current = null;
    filterNodes.current.get(target)?.focus({ preventScroll: true });
  }, [items]);

  const visible = useMemo(
    () =>
      items.filter((item) => {
        if (filter === "all") return true;
        if (filter === "unread") return item.unread;
        return item.kind === filter;
      }),
    [filter, items],
  );

  const groups = useMemo<readonly TidalActivityFeedGroup[]>(() => {
    const renderItem = (item: SampleItem): TidalActivityFeedItem => ({
      ...item,
      destination: {
        href: `#${detailId}`,
        label: `Open local detail for ${String(item.title)}`,
        linkProps: {
          onClick: () => {
            setSelectedId(item.id);
            setMessage(
              `${String(item.title)} opened in the local detail panel.`,
            );
          },
        },
      },
      actions: [
        {
          kind: "button",
          id: "toggle-read",
          label: item.unread ? "Mark read" : "Mark unread",
          buttonProps: { "aria-pressed": !item.unread },
          onAction: () => {
            if (filter === "unread" && item.unread) {
              pendingFilterFocus.current = "unread";
            }
            setItems((current) =>
              current.map((candidate) =>
                candidate.id === item.id
                  ? { ...candidate, unread: !candidate.unread }
                  : candidate,
              ),
            );
            setMessage(
              `${String(item.title)} marked ${item.unread ? "read" : "unread"} in local preview state.`,
            );
          },
        },
      ],
    });
    return [
      {
        id: "today",
        label: "Today",
        items: visible
          .filter((item) => item.groupId === "today")
          .map(renderItem),
      },
      {
        id: "earlier",
        label: "Earlier",
        items: visible
          .filter((item) => item.groupId === "earlier")
          .map(renderItem),
      },
    ];
  }, [detailId, filter, visible]);

  const selected = items.find((item) => item.id === selectedId) ?? items[0];
  const countFor = (id: FilterId) =>
    items.filter((item) => {
      if (id === "all") return true;
      if (id === "unread") return item.unread;
      return item.kind === id;
    }).length;

  return (
    <section className="activity-feed-demo" aria-label="Activity feed preview">
      <div className="activity-feed-demo-layout">
        <TidalActivityFeed
          title="Workspace activity"
          eyebrow={null}
          description="Filter sample activity or open an update."
          groups={groups}
          filter={{
            value: filter,
            label: "Filter fictional activity",
            options: [
              {
                id: "all",
                label: "All",
                count: countFor("all"),
                buttonRef: allFilterRef,
              },
              {
                id: "unread",
                label: "Unread",
                count: countFor("unread"),
                buttonRef: unreadFilterRef,
              },
              {
                id: "comment",
                label: "Comments",
                count: countFor("comment"),
                buttonRef: commentFilterRef,
              },
              {
                id: "change",
                label: "Changes",
                count: countFor("change"),
                buttonRef: changeFilterRef,
              },
            ],
            onValueChange: (value) => {
              setFilter(value as FilterId);
              setMessage(`Showing ${value} activity in local preview state.`);
            },
          }}
          footer={
            <span role="status" aria-live="polite">
              {message} No notification, request, task, or remote record is
              sent.
            </span>
          }
        />

        <article
          id={detailId}
          className="activity-feed-demo-detail"
          tabIndex={-1}
        >
          <span>Local activity detail</span>
          <div className="activity-feed-demo-detail-topline">
            <strong>{selected.category}</strong>
            <time dateTime={selected.dateTime}>{selected.timeLabel}</time>
          </div>
          <h3>{selected.title}</h3>
          <p>{selected.detail}</p>
          <dl>
            <div>
              <dt>Fictional actor</dt>
              <dd>{selected.actor?.name ?? "System sample"}</dd>
            </div>
            <div>
              <dt>Context</dt>
              <dd>{selected.context}</dd>
            </div>
            <div>
              <dt>Read state</dt>
              <dd>{selected.unread ? "Unread" : "Read"}</dd>
            </div>
          </dl>
        </article>
      </div>
    </section>
  );
}

export default function AgentExample() {
  return (
    <div className="tidal-scope" data-theme="light" dir="ltr">
      <style>{tidalExampleStyles}</style>
      <ActivityFeedDemo />
    </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."}

title and uniquely identified consumer-owned groups/items are required. Every item supplies id, native dateTime/timeLabel and title, with optional description, actor, category, context, unread state, destination, native actions, article attributes and ref. Optional controlled filter options compose native button handlers before onValueChange and render only when options exist. Destinations preserve native href/attributes/ref. Link actions preserve modified navigation and explicit aria-disabled false; disabled links suppress caller handling/navigation. Button actions preserve native type/form/disabled/attributes/ref and call onAction only after an unprevented native click. Actor portraits are decorative beside a visible name and fall back to derived/supplied initials. Optional root/group heading levels, labels, emptyMessage, footer and native section attributes/ref remain consumer-owned. The component performs no filtering, read-state mutation, notification, request, routing, analytics, network or storage work.
