# Notification Center

> The bell for the top bar: an unread count on it, and behind it the NotificationList in a popover (a bottom sheet on phones).

Component · Navigation · Pro kit · [Live page](https://ui.twentyfirst.media/pro/components/NotificationCenter/)

The bell for the top bar: an unread count on it, and behind it the `NotificationList` in a popover (a bottom sheet on phones). Items with a `date` are grouped by day ("Today", "Yesterday", the date in the provider's locale), unread ones are marked, each can link to what it is about (`href`, rendered through `linkAs` or `UIProvider linkAs`), and "Mark all read" calls `onReadAll`.

- `items`, `onOpen`, `onReadAll`: the list; opening an item closes the panel.
- `unread` overrides the count on the bell (default: the unread items); above 99 it shows "99+".
- `open` / `onOpenChange` make it controlled; `sheet={false}` keeps the popover on phones.
- `hideFilter` drops the "All / Unread" tabs.
- In `AppShell`, `notifications={{ items, onReadAll }}` puts it at the end of the top bar.
- The bell's accessible name says how many are unread (`notificationsUnread` in `UIProvider messages`).

## Example

```tsx
import * as React from "react";
import { NotificationCenter } from "@twentyfirstmedia/pro";
import type { NotificationItem } from "@twentyfirstmedia/pro";

const NOW = "2026-04-16T12:00:00";
const ITEMS: NotificationItem[] = [
  {
    id: 1,
    icon: "check",
    tint: "butter",
    title: "Approval waiting",
    text: "Send the renewal offer to Northwind?",
    time: "11:40",
    date: "2026-04-16T11:40:00",
    unread: true,
    href: "#approvals",
  },
  {
    id: 2,
    icon: "bot",
    tint: "lilac",
    title: "Research run finished",
    text: "18 companies, 4 new leads",
    time: "09:05",
    date: "2026-04-16T09:05:00",
    unread: true,
    href: "#runs",
  },
  {
    id: 3,
    icon: "mail",
    tint: "sky",
    title: "Lena Hart replied",
    text: "Re: venue for the offsite",
    time: "17:20",
    date: "2026-04-15T17:20:00",
    href: "#mail",
  },
  {
    id: 4,
    icon: "card",
    tint: "mint",
    title: "Invoice RE-2026-00041 paid",
    time: "Mon",
    date: "2026-04-13T10:00:00",
  },
];

export default function Preview() {
  const [items, setItems] = React.useState(ITEMS);
  const [open, setOpen] = React.useState(true);
  return (
    <div
      // overflow: on the narrowest docs pages the panel is wider than the preview box
      style={{
        display: "flex",
        alignItems: "flex-end",
        justifyContent: "flex-end",
        minHeight: 520,
        overflow: "hidden",
      }}
    >
      <NotificationCenter
        items={items}
        now={NOW}
        open={open}
        onOpenChange={setOpen}
        sheet={false}
        side="top"
        onReadAll={() => setItems((all) => all.map((n) => ({ ...n, unread: false })))}
        onOpen={(n) =>
          setItems((all) => all.map((x) => (x.id === n.id ? { ...x, unread: false } : x)))
        }
      />
    </div>
  );
}
```

## Props

### NotificationCenter

| Prop | Type | Notes |
| --- | --- | --- |
| `unread?` | `number` | Unread count on the bell (default: the unread items). |
| `open?` | `boolean` | Whether the list is open (controlled). |
| `defaultOpen?` | `boolean` |  |
| `onOpenChange?` | `(open: boolean) => void` |  |
| `align?` | `"start" \| "end"` | Which edge of the bell the panel lines up with (default `end`). |
| `side?` | `"top" \| "bottom"` | Opens below the bell (default) or above it. |
| `sheet?` | `boolean` | On phones the list opens as a bottom sheet (default true). |
| `className?` | `string` | Extra class on the root element. |
| `style?` | `CSSProperties` | Inline style on the root element. |

### NotificationList

| Prop | Type | Notes |
| --- | --- | --- |
| `items` | `NotificationItem[]` | Required |
| `onOpen?` | `(n: NotificationItem) => void` |  |
| `onReadAll?` | `() => void` |  |
| `linkAs?` | `ElementType` | The element items with an `href` render as (default `UIProvider linkAs`, else `a`). |
| `now?` | `Date \| string \| number` | What counts as today for the day groups (default now). |
| `hideFilter?` | `boolean` | Hide the "All / Unread" tabs. |
| `className?` | `string` | Extra class on the root element. |
| `style?` | `CSSProperties` | Inline style on the root element. |

### DaySeparator

| Prop | Type | Notes |
| --- | --- | --- |
| `date?` | `Date \| string \| number` | The day: shows "Today", "Yesterday" or the weekday and date in the provider's locale. |
| `label?` | `string` | Text instead of the date (e.g. "New messages"). |
| `tone?` | `"neutral" \| "accent"` | "accent" for the "new messages" line (the signal colour). |
| `now?` | `Date \| string \| number` | What counts as today (default now), for stable tests and server rendering. |
| `className?` | `string` | Extra class on the root element. |
| `style?` | `CSSProperties` | Inline style on the root element. |
