# Notification inbox

A controlled in-flow inbox for persistent updates, unread filtering and consumer-owned actions.

Access: pro. Category: Blocks. Kind: composite.

## When to use

- Use it when a page needs a controlled in-flow inbox for persistent updates, unread filtering and consumer-owned actions.
- Choose it inside an authenticated product surface when the host application owns routing, persistence, and service calls.

## Alternatives

- Choose notification-center instead when use the center for a compact app-shell panel rather than a full inbox workflow.

## 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 Notification inbox

```sh
npx shadcn@latest add @tidal-pro/notification-inbox
```

Stylesheets: `components/ui/tidal.css`, `components/ui/notification-inbox.css`.

## Minimal example

```tsx
import"./components/ui/tidal.css";
import"./components/ui/notification-inbox.css";
import{TidalNotificationInbox}from"./components/ui/notification-inbox";
export default()=><div className="tidal-scope"><TidalNotificationInbox items={[{id:"example",title:"Demo",timestamp:"value",read:false}]} onMarkAllRead={() => {}} onReadChange={() => {}}/></div>;
```

## Structured props

- `TidalNotificationInbox.items: ReadonlyArray<TidalNotificationInboxItem>`: Required items value accepted by this exported component.
- `TidalNotificationInbox.onMarkAllRead: (ids: string[]) => void`: Callback invoked when the mark all read interaction is proposed.
- `TidalNotificationInbox.onReadChange: (id: string, read: boolean) => void`: Callback invoked when the read change interaction is proposed.
- `TidalNotificationInbox.allLabel?: string | undefined` (default "All"): Optional all label value accepted by this exported component.
- `TidalNotificationInbox.defaultView?: TidalNotificationInboxView | undefined` (default "all"): Optional default view value accepted by this exported component.
- `TidalNotificationInbox.description?: string | undefined`: Optional description value accepted by this exported component.
- `TidalNotificationInbox.emptyDescription?: string | undefined`: Optional empty description value accepted by this exported component.
- `TidalNotificationInbox.emptyTitle?: string | undefined`: Optional empty title value accepted by this exported component.
- `TidalNotificationInbox.markAllButtonProps?: Omit<ButtonHTMLAttributes<HTMLButtonElement>, "type" | "children"> | undefined`: Optional mark all button props value accepted by this exported component.
- `TidalNotificationInbox.markAllReadLabel?: string | undefined` (default "Mark all read"): Optional mark all read label value accepted by this exported component.
- `TidalNotificationInbox.onAction?: ((itemId: string, actionId: string) => void) | undefined`: Callback invoked when the action interaction is proposed.
- `TidalNotificationInbox.onViewChange?: ((view: TidalNotificationInboxView) => void) | undefined`: Callback invoked when the view change interaction is proposed.
- `TidalNotificationInbox.title?: string | undefined` (default "Notifications"): Optional title value accepted by this exported component.
- `TidalNotificationInbox.unreadLabel?: string | undefined` (default "Unread"): Optional unread label value accepted by this exported component.
- `TidalNotificationInbox.view?: TidalNotificationInboxView | undefined`: Optional view value accepted by this exported component.

## Complete usage example

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

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

import { useState, type MouseEvent } from "react";

import { Check, ClipboardCheck, RotateCcw, Settings2 } from "lucide-react";

import { TidalNotificationInbox, type TidalNotificationInboxItem } from "./components/ui/notification-inbox";

import "./components/ui/notification-inbox.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 .notification-inbox-specimen {\n  width: 100%;\n  max-width: 780px;\n  min-width: 0;\n  padding: 20px;\n  border: 1px solid var(--t-border);\n  border-radius: 18px;\n  background: var(--t-subtle);\n  color: var(--t-ink);\n  box-shadow: 0 24px 48px -36px #00000048;\n  container-type: inline-size;\n}\n\n.tidal-scope .notification-inbox-specimen,\n.tidal-scope .notification-inbox-specimen * {\n  box-sizing: border-box;\n}\n\n.tidal-scope .notification-inbox-demo-header {\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  gap: 16px;\n  margin-bottom: 13px;\n  padding: 0 3px;\n}\n\n.tidal-scope .notification-inbox-demo-header > div {\n  min-width: 0;\n}\n\n.tidal-scope .notification-inbox-demo-header span,\n.tidal-scope .notification-inbox-demo-detail > span {\n  display: block;\n  color: var(--t-muted);\n  font-size: 11px;\n  font-weight: 600;\n  letter-spacing: 0.95px;\n  line-height: 1.4;\n}\n\n.tidal-scope .notification-inbox-demo-header strong {\n  display: block;\n  margin-top: 5px;\n  color: var(--t-ink);\n  font-size: 12px;\n  font-weight: 600;\n  line-height: 1.4;\n  overflow-wrap: anywhere;\n}\n\n.tidal-scope .notification-inbox-demo-header > button {\n  display: inline-flex;\n  align-items: center;\n  justify-content: center;\n  gap: 7px;\n  min-height: 44px;\n  flex: none;\n  padding: 8px 11px;\n  border: 1px solid var(--t-border);\n  border-radius: 10px;\n  background: var(--t-surface);\n  color: var(--t-ink);\n  font: inherit;\n  font-size: 11px;\n  cursor: pointer;\n  transition:\n    background 160ms,\n    transform 140ms var(--t-ease-out);\n}\n\n.tidal-scope .notification-inbox-demo-header > button:hover {\n  background: var(--t-wash);\n}\n\n.tidal-scope .notification-inbox-demo-header > button:active {\n  transform: scale(0.98);\n}\n\n.tidal-scope .notification-inbox-demo-header > button:focus-visible {\n  outline: 2px solid var(--t-accent);\n  outline-offset: 2px;\n}\n\n.tidal-scope .notification-inbox-specimen > .tidal-notification-inbox {\n  max-width: none;\n}\n\n.tidal-scope .notification-inbox-demo-footer {\n  display: grid;\n  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.55fr);\n  gap: 12px;\n  margin-top: 13px;\n}\n\n.tidal-scope .notification-inbox-demo-detail,\n.tidal-scope .notification-inbox-demo-status {\n  min-width: 0;\n  margin: 0;\n  border: 1px solid var(--t-border);\n  border-radius: 11px;\n  background: var(--t-surface);\n}\n\n.tidal-scope .notification-inbox-demo-detail {\n  padding: 15px 16px;\n  scroll-margin-block: 15px;\n}\n\n.tidal-scope .notification-inbox-demo-detail > strong {\n  display: block;\n  margin-top: 7px;\n  color: var(--t-ink);\n  font-size: 11px;\n  font-weight: 600;\n  line-height: 1.45;\n  overflow-wrap: anywhere;\n}\n\n.tidal-scope .notification-inbox-demo-detail > p,\n.tidal-scope .notification-inbox-demo-status {\n  color: var(--t-muted);\n  font-size: 11px;\n  line-height: 1.6;\n  overflow-wrap: anywhere;\n}\n\n.tidal-scope .notification-inbox-demo-detail > p {\n  margin: 5px 0 0;\n}\n\n.tidal-scope .notification-inbox-demo-status {\n  display: flex;\n  align-items: center;\n  padding: 15px 16px;\n}\n\n@container (max-width: 520px) {\n  .tidal-scope .notification-inbox-demo-footer {\n    grid-template-columns: 1fr;\n  }\n}\n\n@media (max-width: 390px) {\n  .tidal-scope .notification-inbox-specimen {\n    padding: 10px;\n  }\n\n  .tidal-scope .notification-inbox-demo-header {\n    align-items: flex-start;\n    flex-direction: column;\n  }\n\n  .tidal-scope .notification-inbox-demo-header > button {\n    width: 100%;\n  }\n}\n\n@media (prefers-reduced-motion: no-preference) {\n  .tidal-scope .notification-inbox-demo-header,\n  .tidal-scope .notification-inbox-demo-footer {\n    animation: notification-inbox-demo-enter 420ms var(--t-ease-out) both;\n  }\n\n  .tidal-scope .notification-inbox-demo-footer {\n    animation-delay: 120ms;\n  }\n}\n\n@keyframes notification-inbox-demo-enter {\n  from {\n    opacity: 0;\n    transform: translateY(6px);\n  }\n  to {\n    opacity: 1;\n    transform: none;\n  }\n}\n\n@media (prefers-reduced-motion: reduce) {\n  .tidal-scope .notification-inbox-demo-header > button {\n    transition-duration: 0.01ms;\n  }\n\n  .tidal-scope .notification-inbox-demo-header > button:active {\n    transform: none;\n  }\n}";

const INITIAL_ITEMS = [
  {
    id: "launch-brief",
    title: "Lena Ortiz assigned the launch brief",
    description: "Review the final sections before the local sample deadline.",
    timestamp: "4 min ago",
    dateTime: "2026-10-14T18:24:00-05:00",
    category: "Assignment",
    read: false,
    avatar: { src: tidalExampleAvatarDataUri("01"), alt: "" },
    detail: { label: "View brief", href: "#notification-demo-detail" },
    action: { id: "review", label: "Review update" },
  },
  {
    id: "website-note",
    title: "Noah Kim mentioned you in Website notes",
    description: "The navigation copy is ready for a local review.",
    timestamp: "18 min ago",
    dateTime: "2026-10-14T18:10:00-05:00",
    category: "Mention",
    read: false,
    avatar: { src: tidalExampleAvatarDataUri("02"), alt: "" },
    detail: { label: "Read note", href: "#notification-demo-detail" },
  },
  {
    id: "agenda-file",
    title: "Casey Morgan added the weekly agenda",
    description: "A fictional meeting document is listed in this preview.",
    timestamp: "42 min ago",
    dateTime: "2026-10-14T17:46:00-05:00",
    category: "File",
    read: true,
    avatar: { src: tidalExampleAvatarDataUri("03"), alt: "" },
    detail: { label: "View details", href: "#notification-demo-detail" },
  },
  {
    id: "campaign-review",
    title: "Priya Shah moved Campaign to review",
    description: "The local board now shows the project in its review column.",
    timestamp: "1 hr ago",
    dateTime: "2026-10-14T17:22:00-05:00",
    category: "Project",
    read: false,
    avatar: { src: tidalExampleAvatarDataUri("04"), alt: "" },
    detail: { label: "View project", href: "#notification-demo-detail" },
  },
  {
    id: "workspace-settings",
    title: "Workspace settings were updated",
    description: "Notification preferences changed in this fictional sample.",
    timestamp: "2 hr ago",
    dateTime: "2026-10-14T16:12:00-05:00",
    category: "System",
    read: true,
    icon: <Settings2 size={17} />,
    detail: { label: "View summary", href: "#notification-demo-detail" },
  },
  {
    id: "feedback-request",
    title: "Jordan Lee requested feedback",
    description: "Two layout decisions are ready for local review.",
    timestamp: "Yesterday",
    dateTime: "2026-10-13T15:35:00-05:00",
    category: "Review",
    read: false,
    avatar: { src: tidalExampleAvatarDataUri("05"), alt: "" },
    detail: { label: "View request", href: "#notification-demo-detail" },
    action: { id: "review", label: "Review update" },
  },
  {
    id: "comment-resolved",
    title: "Maya Chen resolved three comments",
    description:
      "The resolved notes remain available in the local detail view.",
    timestamp: "Yesterday",
    dateTime: "2026-10-13T11:08:00-05:00",
    category: "Comment",
    read: true,
    avatar: { src: tidalExampleAvatarDataUri("06"), alt: "" },
    detail: { label: "View comments", href: "#notification-demo-detail" },
  },
] satisfies TidalNotificationInboxItem[];

function isPlainPrimaryClick(event: MouseEvent<HTMLAnchorElement>) {
  return (
    event.button === 0 &&
    !event.metaKey &&
    !event.ctrlKey &&
    !event.altKey &&
    !event.shiftKey
  );
}

export function NotificationInboxDemo() {
  const [items, setItems] = useState<TidalNotificationInboxItem[]>(() =>
    INITIAL_ITEMS.map((item) => ({ ...item })),
  );
  const [selectedId, setSelectedId] = useState(INITIAL_ITEMS[0].id);
  const [handled, setHandled] = useState<Set<string>>(() => new Set());
  const [status, setStatus] = useState(
    "Fictional local updates. No service is connected.",
  );
  const selected =
    items.find((item) => item.id === selectedId) ?? items[0] ?? null;

  const displayItems = items.map((item) => ({
    ...item,
    detail: item.detail
      ? {
          ...item.detail,
          linkProps: {
            onClick: (event: MouseEvent<HTMLAnchorElement>) => {
              if (!event.defaultPrevented && isPlainPrimaryClick(event)) {
                event.preventDefault();
                setSelectedId(item.id);
                setStatus(`Showing ${item.title} in the local detail panel.`);
              }
            },
          },
        }
      : undefined,
    action: item.action
      ? {
          ...item.action,
          label: handled.has(item.id) ? "Reviewed" : item.action.label,
          icon: handled.has(item.id) ? (
            <Check size={15} />
          ) : (
            <ClipboardCheck size={15} />
          ),
          buttonProps: { disabled: handled.has(item.id) },
        }
      : undefined,
  }));

  function reset() {
    setItems(INITIAL_ITEMS.map((item) => ({ ...item })));
    setSelectedId(INITIAL_ITEMS[0].id);
    setHandled(new Set());
    setStatus("Fictional local updates reset. No service is connected.");
  }

  return (
    <section className="notification-inbox-specimen">
      <header className="notification-inbox-demo-header">
        <div>
          <strong>Fictional local updates</strong>
        </div>
        <button type="button" onClick={reset}>
          <RotateCcw size={15} aria-hidden="true" />
          Reset sample
        </button>
      </header>

      <TidalNotificationInbox
        title="Updates"
        description="Project activity and requests"
        items={displayItems}
        onReadChange={(id, read) => {
          setItems((current) =>
            current.map((item) => (item.id === id ? { ...item, read } : item)),
          );
          const item = items.find((candidate) => candidate.id === id);
          setStatus(
            `${item?.title ?? "Update"} marked ${read ? "read" : "unread"} locally.`,
          );
        }}
        onMarkAllRead={(ids) => {
          const idSet = new Set(ids);
          setItems((current) =>
            current.map((item) =>
              idSet.has(item.id) ? { ...item, read: true } : item,
            ),
          );
          setStatus(
            `${ids.length} fictional ${ids.length === 1 ? "update" : "updates"} marked read locally.`,
          );
        }}
        onAction={(itemId) => {
          setHandled((current) => new Set(current).add(itemId));
          setSelectedId(itemId);
          setStatus("Review state updated locally. No request was sent.");
        }}
      />

      <div className="notification-inbox-demo-footer">
        <div
          className="notification-inbox-demo-detail"
          id="notification-demo-detail"
        >
          <span>SELECTED UPDATE</span>
          {selected ? (
            <>
              <strong>{selected.title}</strong>
              <p>{selected.description}</p>
            </>
          ) : (
            <p>No local update selected.</p>
          )}
        </div>
        <p className="notification-inbox-demo-status" role="status">
          {status}
        </p>
      </div>
    </section>
  );
}

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

```

## Gotchas

- Install the declared registry dependencies and render inside a tidal-scope with the foundation stylesheet loaded.

## 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.","Arrow-key behavior follows the exported composite-control implementation."],"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."}

items is a controlled typed array of unique {id,title,description?,timestamp,dateTime?,category?,read,avatar?,icon?,detail?,action?,readButtonProps?,readButtonRef?}. Avatar alt text is exposed when supplied; an empty or omitted alt keeps the image decorative, while fallback art and the unread dot stay hidden from assistive technology. onReadChange(id,read) and onMarkAllRead(ids) are required requests; onAction(itemId,actionId) is optional. Optional controlled view/onViewChange or defaultView, title, description, labels, markAllButtonProps, empty copy and native root div attributes/ref. Detail links forward native anchor attributes/ref and preserve href/target/download behavior. Item actions forward native button attributes/ref and default to type=button; explicit submit behavior is preserved. Read, view, mark-all and empty-view controls are native type=button. The component performs no request, persistence, timing, toast announcement or automatic mutation.
