# Activity

> Everything agents read and did across your services, filterable by changes, money and reads, with "Undo" on changes and the money decision that waits for you in an approval card beside it.

Pattern · Halo kit · [Live page](https://ui.twentyfirst.media/halo/patterns/ActivityScreen/)

Everything agents read and did across your services, filterable by changes, money and reads, with
"Undo" on changes and the money decision that waits for you in an approval card beside it.

## Code

```tsx
import * as React from "react";
import {
  AgentActivity,
  AppShell,
  ApprovalCard,
  PageHeader,
  Panel,
  Segmented,
  Stagger,
} from "@twentyfirstmedia/halo";
import type { AgentAction, SidebarGroup } from "@twentyfirstmedia/halo";
import "./_connectors";

const NAV: SidebarGroup[] = [
  {
    items: [
      { id: "today", label: "Today", icon: "sun" },
      { id: "assistant", label: "Assistant", icon: "sparkle" },
    ],
  },
  {
    label: "Agents",
    items: [
      { id: "connections", label: "Connections", icon: "link" },
      { id: "activity", label: "Activity", icon: "list", badge: "1" },
      { id: "access", label: "Data access", icon: "shield" },
    ],
  },
];

const now = new Date(2026, 10, 14, 9, 30);
const at = (day: number, h: number, m: number) => new Date(2026, 10, 14 + day, h, m);

const ITEMS: AgentAction[] = [
  {
    id: "1",
    service: { name: "N26", icon: "brandN26" },
    agent: "Money agent",
    text: "Wants to cancel the second music subscription (€10.99 a month)",
    at: at(0, 9, 12),
    kind: "money",
    state: "waiting",
  },
  {
    id: "2",
    service: { name: "tado°", icon: "brandTado" },
    agent: "Home agent",
    text: "Turned the heating down to 17 °C: nobody is home",
    at: at(0, 8, 41),
    kind: "act",
  },
  {
    id: "3",
    service: { name: "Tesla", icon: "brandTesla" },
    agent: "Home agent",
    text: "Started charging to 80 % for tomorrow's drive to Hamburg",
    at: at(0, 7, 58),
    kind: "act",
  },
  {
    id: "4",
    service: { name: "Gmail", icon: "brandGmail" },
    agent: "Assistant",
    text: "Read 14 new emails and filed 3 invoices to Drive",
    at: at(0, 7, 5),
    kind: "read",
  },
  {
    id: "5",
    service: { name: "Google Calendar", icon: "brandGooglecalendar" },
    agent: "Assistant",
    text: "Moved the dentist to Friday, 10:00",
    detail: "The old slot clashed with your flight to Dubai.",
    at: at(-1, 18, 20),
    kind: "act",
    state: "undone",
  },
  {
    id: "6",
    service: { name: "Spotify", icon: "brandSpotify" },
    agent: "Assistant",
    text: "Looked up what you played this week for the weekly review",
    at: at(-1, 17, 2),
    kind: "read",
  },
];

/** What agents did across your services, what waits for you, filtered by kind. */
export default function Preview() {
  const [kind, setKind] = React.useState("all");
  const items = ITEMS.filter((i) => kind === "all" || i.kind === kind);
  return (
    <AppShell
      navigation="sidebar"
      brand="Life"
      sidebarGroups={NAV}
      active="activity"
      user={{ name: "Mara Ellis", email: "mara@halo.app" }}
      dock={false}
      side={
        <Panel side title="Waiting for you" subtitle="1 decision">
          <ApprovalCard
            compact
            family="money"
            agent="Money agent"
            age="18 min"
            title="Cancel Apple Music"
            text="You pay for Spotify and Apple Music. Cancelling Apple Music saves €131.88 a year."
            onDecide={() => {}}
          />
        </Panel>
      }
    >
      <div className="tf-in">
        <PageHeader title="Activity" subtitle="Everything your agents read and did" />
      </div>
      <Stagger className="tf-col" style={{ gap: 16 }}>
        <Segmented
          label="Show"
          value={kind}
          onChange={setKind}
          options={[
            { value: "all", label: "All" },
            { value: "act", label: "Changes" },
            { value: "money", label: "Money" },
            { value: "read", label: "Reads" },
          ]}
        />
        <Panel>
          <AgentActivity items={items} now={now} onUndo={() => {}} onReview={() => {}} />
        </Panel>
      </Stagger>
    </AppShell>
  );
}
```

## Props

### AgentActivity

| Prop | Type | Notes |
| --- | --- | --- |
| `items` | `AgentAction[]` | Required |
| `now?` | `Date \| string \| number` | "Now" for the day headings; pass it so server and client render the same. |
| `onUndo?` | `(id: string) => void` | Offers "Undo" on finished actions that changed something. |
| `onReview?` | `(id: string) => void` | Opens an action that waits for your approval. |
| `label?` | `string` | Accessible name (default "Agent activity"). |
| `className?` | `string` | Extra class on the root element. |
| `style?` | `CSSProperties` | Inline style on the root element. |

### AppShell

| Prop | Type | Notes |
| --- | --- | --- |
| `active?` | `string` |  |
| `brand?` | `ReactNode` | The product name, or a node (a logo mark with the name; collapsed sidebars show it whole). |
| `brandDot?` | `boolean` | The status dot after the brand (default `true`); turn it off next to a logo of your own. |
| `tag?` | `string` |  |
| `nav?` | `NavItem[]` |  |
| `user?` | `{ name: string; email?: string }` |  |
| `onNavigate?` | `(label: string) => void` |  |
| `topExtra?` | `ReactNode` |  |
| `sheetStyle?` | `CSSProperties` |  |
| `contentKey?` | `string \| number` |  |
| `side?` | `ReactNode` |  |
| `dock?` | `boolean` |  |
| `dockItems?` | `DockProps["items"]` |  |
| `railTop?` | `RailItem[]` |  |
| `railBottom?` | `RailItem[]` |  |
| `fill?` | `boolean` | The shell is the whole page: at least the viewport's height (100dvh), no outer radius, the sheet fills the rest; on desktop the sidebar stays in view while the page scrolls, on phones the sheet starts right under the sidebar's bar. |
| `navigation?` | `"top" \| "sidebar"` |  |
| `sidebarGroups?` | `SidebarGroup[]` | With `navigation="sidebar"`: groups instead of the flat `nav` list. |
| `sidebar?` | `Partial<Omit<SidebarProps, "variant" \| "groups">>` | With `navigation="sidebar"`: more sidebar props (collapsed, storageKey, shortcut, linkAs …). |
| `workspaces?` | `WorkspaceSwitcherProps` | With `navigation="sidebar"`: the workspace switcher at the top instead of the brand. |
| `userMenu?` | `(MenuItem \| "-")[]` | The account menu's entries (with `navigation="sidebar"` at the foot of the sidebar). |
| `topbar?` | `boolean \| ReactNode` | With `navigation="sidebar"`: a bar across the top of the frame. The brand (or `workspaces`) moves into its start, as wide as the sidebar below it (expanded or collapsed); `topStart` follows it, `topEnd` sits at the end. Frame, bar and sidebar read as one L around the sheet. Content given here goes between `topStart` and `topEnd`. On phones the bar is the sidebar's bar (menu button and brand) with `topEnd` on the right and `topStart` behind an icon button. |
| `topStart?` | `ReactNode` | With `topbar`: right after the brand, e.g. a search field or a command palette trigger. |
| `topEnd?` | `ReactNode` | With `topbar`: at the end of the bar (buttons, menus); `topExtra` goes there too. |
| `topStartCompact?` | `ReactNode` | With `topbar` on phones: what stands in for `topStart` (default: an icon button that opens `topStart` over the bar). |
| `topStartIcon?` | `IconName` | The icon of that button (default `search`). |
| `topStartLabel?` | `string` | The accessible name of that button (default "Search"). |
| `children?` | `ReactNode` |  |
| `className?` | `string` | Extra class on the root element. |
| `style?` | `CSSProperties` | Inline style on the root element. |

### ApprovalCard

| Prop | Type | Notes |
| --- | --- | --- |
| `title` | `ReactNode` | Required |
| `text?` | `ReactNode` |  |
| `children?` | `ReactNode` |  |
| `agent?` | `string` |  |
| `project?` | `string` |  |
| `family?` | `RiskFamily` |  |
| `familyLabel?` | `string` |  |
| `age?` | `string` |  |
| `escalation?` | `ReactNode` |  |
| `trace?` | `ReactNode` |  |
| `note?` | `ReactNode` |  |
| `heading?` | `string` |  |
| `options?` | `ApprovalOption[]` |  |
| `approveLabel?` | `string` |  |
| `onDecide?` | `(key: ApprovalKey, text?: string) => void` |  |
| `decision?` | `ApprovalDecision \| null` |  |
| `compact?` | `boolean` |  |
| `onApprove?` | `() => void` |  |
| `onDeny?` | `() => void` |  |
| `onEdit?` | `(text: string) => void` |  |
| `state?` | `"approved" \| "denied"` |  |
| `className?` | `string` | Extra class on the root element. |
| `style?` | `CSSProperties` | Inline style on the root element. |

### PageHeader

| Prop | Type | Notes |
| --- | --- | --- |
| `crumbs?` | `(string \| Crumb)[]` | A breadcrumb above the title (see `Breadcrumb`): labels, or items with `href`/`onClick`. |
| `crumbLinkAs?` | `ElementType` | The element crumb links render as, e.g. Next.js `Link`. |
| `title` | `string` | Required |
| `subtitle?` | `string` |  |
| `actions?` | `ReactNode[]` |  |
| `className?` | `string` | Extra class on the root element. |
| `style?` | `CSSProperties` | Inline style on the root element. |

### Panel

| Prop | Type | Notes |
| --- | --- | --- |
| `side?` | `boolean` |  |
| `title?` | `string` |  |
| `subtitle?` | `string` |  |
| `action?` | `ReactNode` |  |
| `children?` | `ReactNode` |  |
| `surface?` | `Surface` | `"glass"`: translucent glass over what is behind (maps, 3D, video, photos); `"solid"` opts out inside a glass `UIProvider`. |
| `className?` | `string` | Extra class on the root element. |
| `style?` | `CSSProperties` | Inline style on the root element. |

### Segmented

| Prop | Type | Notes |
| --- | --- | --- |
| `options` | `(string \| Option)[]` | Required |
| `value?` | `string` |  |
| `defaultValue?` | `string` |  |
| `onChange?` | `(v: string) => void` |  |
| `size?` | `"sm"` |  |
| `block?` | `boolean` |  |
| `label?` | `string` |  |
| `className?` | `string` | Extra class on the root element. |
| `style?` | `CSSProperties` | Inline style on the root element. |
