Xzero UI
Pro library

Notification center

A home for updates with read state, grouped information, and animated disclosure.

$ pnpm dlx shadcn@4.23.0 add @xzero-ui/notification-center
Live · keyboard ready

Use it when updates need a persistent home instead of a brief toast. Connect read state to your data store.

When to use

When not to use

Installation

Register both Xzero UI namespaces in your project's components.json:

{
  "registries": {
    "@xzero-ui": "https://mcp.xzero.co.uk/r/{name}.json",
    "@xzero-ui-pro": "https://mcp.xzero.co.uk/r/pro/{name}.json"
  }
}
npx shadcn@4.23.0 add @xzero-ui/notification-center

Install xzero-foundation once, and import @/components/xzero/foundation.css in your app root. No Xzero token is used by this snapshot. For sample portraits, photos, fonts, or logos, download https://mcp.xzero.co.uk/install-assets.mjs and run node xzero-install-assets.mjs <receiving-project>.

Usage

import { NotificationCenter } from "@/components/xzero/notification-center/notification-center";

export function HeaderBell() {
  return (
    <NotificationCenter
      notifications={[
        { id: "1", title: "Deploy finished", time: "2m", tone: "success" },
        { id: "2", title: "Ana commented", time: "1h", actor: { name: "Ana", photo: "/ana.jpg" } },
      ]}
      onReadChange={(item, read) => markRead(item.id, read)}
      onDismiss={item => dismiss(item.id)}
    />
  );
}

API reference

NotificationCenter

A bell trigger with an unread badge that opens a popover of notifications with All and Unread views, expandable rows, and bulk actions.

PropTypeDefaultDescription
notifications (required)NotificationItem[]–Initial notifications. The component keeps its own copy after mount.
labelstring"Notifications"Panel heading and trigger label.
onReadChange(notification: NotificationItem, read: boolean) => void–Called for each item marked read or unread, including Mark all read.
onDismiss(notification: NotificationItem) => void–Called for each dismissed item, including Clear read.
openboolean–Controlled open state.
onOpenChange(open: boolean) => void–Called when the popover opens or closes.
avoidCollisionsbooleantrueLets the popover flip or shift to stay in the viewport.

NotificationItem

Item type: { id: string; title: string; description?: string; time: string; read?: boolean; tone?: "info" | "success" | "warning"; actor?: { name: string; photo: string } }. actor shows an avatar instead of a tone icon.

No props.

Keyboard interactions

KeysAction
Enter / SpaceOpens the panel from the trigger, toggles a row's details, and activates actions.
EscapeCloses the panel and returns focus to the trigger (Radix Popover).
TabMoves through view toggles, rows, and row actions.

Accessibility

Motion

Responsive behavior

Performance

Notes for AI

Guidance for AI tools

Blocks are complete, self-contained screens with sample data. Replace the sample data and connect the callbacks described above. Follow the declared prop types and do not invent props. Keep keyboard access, reduced motion support, and both light and dark themes intact when adapting it.

Full library index: https://ui.xzero.co.uk/llms.txt

Browse all components