# NotificationCenter: the bell and its list

NotificationCenter is the bell in the top bar of an app built on Meadowstack, beside the assistant, with the count of what is unread. Its list groups notifications by day, lets a notification carry actions that run where they are, and archives with an Undo.

Checked 2 December 2026. By Bohuslav Poláček. https://meadowstack.com/components/notification-center/

*What a page built ahead of time can show: the top of Stonebridge's app with Robert Brooks's bell, three of six unread. The list opens in a popover that only a running page draws; the table below holds what it lists.*

A live screen, rendered from the kit's components on the page: https://meadowstack.com/components/notification-center/

## What it is for

Every app built on Meadowstack has one bell, in the top bar beside the assistant's button. The count on it is what is unread; the list behind it is what changed for this person since they last looked: a valuation returned, a snag reported from a phone, a certificate about to expire.

The preview is the part that a page built ahead of time can render: the top of the [Stonebridge example](https://meadowstack.com/examples/construction-site-management/) with Robert Brooks's bell and his three unread notifications. In the running app a click opens the list in a popover. It has a header with **Mark all read**, a switch between All and Unread with its count, and groups for Today, Yesterday and Earlier. Each notification shows the person's avatar or the system's mark, a dot while unread, the title, two lines of the body and the time. A notification may carry its own actions: **Request the new one** runs in place and the button turns into **Requested by e-mail**. Archiving folds the row away and offers Undo.

The manifest keeps it to one place: once in `AppShell`'s top bar. A warning on a page is a `Notice`, a passing confirmation a toast.

## The rules and where they live

- **The bell sits in the top bar beside the assistant; the account at the foot of the sidebar.** The root `AGENTS.md`, under navigation in Apps do work, and people never get lost.
- **A bell with actions in the notification itself, grouped Today, Yesterday, Earlier, archive with Undo.** `docs/patterns.md`, Shell and navigation; you can open it in any company of the demo.
- **Roles change the data, the bell included.** `AGENTS.md`, Permissions and audit: an external role (client, customer, guest) never sees internal costs, margins or other clients' records, "in widgets, feeds, the bell, palette results and assistant answers as on the pages". The demo checks every item's permits before it reaches the bell, as the code below shows.
- **One action goes the whole way and ends with a notification.** `AGENTS.md`: a proposal with its impact, a confirm, the change through the module's api as the person, then the notification; the recipe is `docs/recipes/notifications-and-assistant.md`.
- **Colour carries information only.** `AGENTS.md`: unread is a dot, a person keeps their avatar's hue, and no notification is painted red to be noticed.

## What AI coding tools write instead

The manifest names **a hand-built bell dropdown**. The usual one shows a red badge on every page, lists every event of the system to everyone, and sends people away to act on anything: a click on "Insurance expires" opens the subcontractor's page, where the person has to find the button again. Read state is per item only, delete has no way back, and the list grows until it is a second inbox.

The bigger risk is the permission gap. A feed built from the database without asking `can` shows a client the note about another client's invoice, because the bell was never part of the permission design. In Meadowstack each item says what it requires, the bell filters by the person's permissions as the pages do, and `NotificationCenter` gives the list its fixed shape: groups by day, at most a couple of actions in place, archive with Undo.

## How to use it

Pass it once to `AppShell` as `notifications`.

| Prop | What it takes |
| --- | --- |
| `items` | `NotificationItem[]`: `id`, `title`, `body`, `time` (ISO), `unread`, `person` (a name for the avatar) or `icon` for the system, `tone`, `href`, `actions`. |
| `actions` (per item) | `label`, `onAction`, `doneLabel` (shown once it ran), `primary`. |
| `onOpen` | A notification was clicked: mark it read and go to its `href`. |
| `onMarkRead`, `onMarkAllRead` | Read state, one or all. |
| `onArchive`, `onRestore` | Archive, and the Undo that puts it back. |
| `renderLink`, `now` | Your router's link, and the clock for the relative times. |

## Its entry in the manifest

*The component's rules as the kit's manifest states them, the same entry an AI coding tool reads.*

| Manifest field | NotificationCenter |
| --- | --- |
| What it is | The bell in the top bar and its list of notifications. |
| Use it for | Once in AppShell's top bar. |
| Not for | For a page's warnings (Notice); For passing confirmations (toast) |
| It replaces | A hand-built bell dropdown |
| Screen types | Shell |
| Import | `import { NotificationCenter } from "@meadowstack-studio/kit";` |

Read from the kit's component manifest when the site was built (126 components, packages/kit/src/components.json); the same entry answers an AI coding tool through the kit's MCP server.

## What the bell lists in the demo

*Robert Brooks's bell at Stonebridge on the morning of 2 December 2026, from apps/demo/src/shared/extras/stonebridge.ts. Each item names the permissions it needs, and a person without them never gets it.*

| Group | Notification | From | Unread | Action inside |
| --- | --- | --- | --- | --- |
| Today | Valuation returned with a note | Eve Horton | Yes | None |
| Today | A new snag from the foreman's phone | Joe Vaughan | Yes | None |
| Today | Frost on Monday: a proposal to move the pour | The system | Yes | None |
| Today | Kline Air Systems: public liability insurance expires in 25 days | Kline Air Systems | No | Request the new one, then Requested by e-mail |
| Yesterday | Volvo EC220E excavator: service in 38 engine hours | The system | No | None |
| Yesterday | The Halifax health centre diary signed | Lucy King | No | None |

## How the demo feeds it

*Only what the person may see reaches the bell: each item's permits are checked with can, read and archived are kept for the visit, and an action runs as a request.*

From `apps/demo/src/workspace/extras-parts.tsx` in the Meadowstack repository:

```tsx
/** The bell: only what the person may see (each item's permits), read and archived kept for the visit, an action runs as a request. */
export function WorkspaceNotifications({ extras, base }: { extras: CompanyExtras | undefined; base: string }) {
  const navigate = useNavigate();
  const [read, setRead] = useState<Record<string, boolean>>({});
  const [archived, setArchived] = useState<Record<string, boolean>>({});
  const [now] = useState(() => new Date());
  const can = useCan();

  // What the assistant's changes sent this visit comes first, then the morning's.
  const { company, person } = useWorkspace();
  const sent = useSentNotifications(company.slug);
  const items: NotificationItem[] = [...sent, ...(extras?.notifications ?? [])]
    .filter(
      (item) => !archived[item.id] && permitted(item.requires, can) && (!item.for || item.for.includes(person.id)),
    )
    .map((item) => ({
      id: item.id,
      title: item.title,
      body: item.body,
      time: ago(item.minutesAgo),
      unread: Boolean(item.unread) && !read[item.id],
      person: item.person,
      href: item.href ? `${base}/${item.href}` : undefined,
      actions: item.actions?.map((action) => ({
        label: action.label,
        doneLabel: action.doneLabel,
        primary: action.primary,
        onAction: () => request(() => undefined),
      })),
    }));

  return (
    <NotificationCenter
```

## Questions

### Where does the notification bell go?

In the top bar, beside the assistant's button, once per app through the shell's notifications slot. On a phone it stays in the header beside the menu button.

### Can a notification do something without leaving the page?

Yes. A notification can carry its own actions, such as Request the new one in the demo; it runs in place, and its button turns into the done label, Requested by e-mail.

### Does everyone see the same notifications?

No. Each notification names the permissions it needs and is checked against the person before it reaches the bell, so a client or a guest never sees another client's records or internal costs there, just as on the pages.

### What happens when someone archives one by mistake?

The row folds away and a toast offers Undo, which puts it back where it was.

## Related

- [AssistantPanel: the assistant beside the page](https://meadowstack.com/components/assistant-panel/) (Components)
- [One inbox for every member's message](https://meadowstack.com/screens/shared-inbox/) (Screens)
- [The settings screen](https://meadowstack.com/patterns/settings/) (Patterns)
- [From a Lovable or Bolt prototype to a built app](https://meadowstack.com/from/lovable-bolt-prototype/) (Moving from)
- [A change order that shows its price before anyone approves it](https://meadowstack.com/screens/change-order-form/) (Screens)
- [A construction schedule that reads the weather](https://meadowstack.com/screens/construction-schedule/) (Screens)
