A bell with an unread count and a panel of notifications. Tabs split All, Mentions and Agents; days group the list; agent runs carry their state and inline actions such as Approve. It is controlled: you pass the items and handle read, action and load-more. Below 640px the panel opens as a full-height sheet. The names, runs and events shown are made up.
On this page
- Bell with unread count
- Agent approval requests
- Mentions inbox
- Run finished alerts
- Mobile notification sheet
Examples
Bell and popoverFree
Installation
npx knowns-ui@latest add notification-centerPaste this into your coding agent (Claude Code, Cursor, Codex). It checks your project, sets up the registry, runs the install and verifies it.
Install Notification center from Knowns UI into this project. Work step by step, show me each change, and ask before you edit files outside this project.
Context: Knowns UI (https://ui.knowns.dev) is a shadcn registry. Items land in the project as source files. Docs: https://ui.knowns.dev/docs/notification-center
1. Check the project first. Stop and tell me if any of these is missing:
- React 19 and Tailwind CSS v4.
- A components.json at the project root. If there is none, ask me before running `npx knowns-ui@latest init --no-key` (it runs shadcn init when needed, then adds the registries).
2. Run:
```bash
npx knowns-ui@latest add notification-center
```
It writes these files:
- lib/knowns/run.ts
- lib/knowns/json.tsx
- lib/knowns/status.ts
- lib/knowns/tone.ts
- lib/knowns/types.ts
- lib/knowns/use-abortable.ts
- lib/knowns/utils.ts
- lib/knowns/motion.tsx
- lib/knowns/motion-utils.ts
- components/ui/knowns/use-floating.ts
- components/ui/knowns/tooltip.tsx
- components/ui/knowns/tooltip-utils.ts
- components/ui/knowns/avatar.tsx
- components/ui/knowns/spinner.tsx
- components/ui/knowns/button.tsx
- components/ui/knowns/dialog.tsx
- components/ui/knowns/popover.tsx
- components/ui/knowns/tabs.tsx
- components/ui/knowns/blocks/application/notification-center.tsx
- components/ui/knowns/blocks/application/app-feed-utils.ts
- components/ui/knowns/blocks/application/notification-utils.ts
and installs these npm packages: clsx@^2.1.1, tailwind-merge@^3.7.0, class-variance-authority@^0.7.1.
3. While it runs:
- It also adds a few @keyframes (all named kn-*) to the global CSS file (globals.css or the file components.json points at). Let it: they only add animations.
- If it asks to overwrite files under lib/knowns/: these are shared by every Knowns UI item. List them, say whether I changed them (check git), and ask me before you answer.
- If it asks to overwrite any other file, show me the diff and ask me.
4. Verify:
- Every file in the list above exists.
- The project type-checks (for example `npx tsc --noEmit`) and the dev build has no new errors.
5. Use it: follow the examples and props on https://ui.knowns.dev/docs/notification-center, and ask me if anything about my data is unclear.
If the Knowns UI MCP server is connected (https://ui.knowns.dev/docs/ai-and-mcp), use get_component({ name: "notification-center" }) or search_docs for details.
Finish with a short summary: the files you added or changed, the packages you installed, and anything I still need to do.Props
- itemsrequired
NotificationItem[]- id, type (mention | agent | update), title, body, at (ms), read, actor, state (finished | needs-approval | failed), actions.
- now
number- Default
first render time - The clock in ms. Pass it so day groups and "5m" match on server and client.
- timeZone
string- Default
"UTC" - The zone that cuts days. A fixed zone keeps server and client output the same.
- onRead
(id, read) => void- One notification was marked read or unread.
- onReadAll
(ids) => void- "Mark all read" on the tab shown; gets the ids that were unread.
- onAction
(item, actionId) => void- An inline button was pressed.
- onOpen
(item) => void- The row was pressed.
- onLoadMore / hasMore / loadingMore
() => void / boolean / boolean- The end of the list scrolled into view, or "Show older" was pressed.
- open / onOpenChange
boolean / (open) => void- Default
uncontrolled - NotificationCenter only: the popover or sheet.
- label
string- Default
"Notifications" - NotificationCenter only: the name of the bell and the panel.
- emptyText
string- Default
"You are all caught up." - Shown when a tab has nothing.
- headingLevel
2|3|4- Default
3 - Level of the day headings; set it so heading levels do not skip on your page.
| Prop | Type | Default | Description |
|---|---|---|---|
| itemsrequired | NotificationItem[] | required | id, type (mention | agent | update), title, body, at (ms), read, actor, state (finished | needs-approval | failed), actions. |
| now | number | first render time | The clock in ms. Pass it so day groups and "5m" match on server and client. |
| timeZone | string | "UTC" | The zone that cuts days. A fixed zone keeps server and client output the same. |
| onRead | (id, read) => void | - | One notification was marked read or unread. |
| onReadAll | (ids) => void | - | "Mark all read" on the tab shown; gets the ids that were unread. |
| onAction | (item, actionId) => void | - | An inline button was pressed. |
| onOpen | (item) => void | - | The row was pressed. |
| onLoadMore / hasMore / loadingMore | () => void / boolean / boolean | - | The end of the list scrolled into view, or "Show older" was pressed. |
| open / onOpenChange | boolean / (open) => void | uncontrolled | NotificationCenter only: the popover or sheet. |
| label | string | "Notifications" | NotificationCenter only: the name of the bell and the panel. |
| emptyText | string | "You are all caught up." | Shown when a tab has nothing. |
| headingLevel | 2 | 3 | 4 | 3 | Level of the day headings; set it so heading levels do not skip on your page. |
The bell announces its count ("Notifications, 3 unread notifications"). New items are read out through a polite live region. Unread rows carry a dot and a hidden "Unread" label; colour is used only for the unread dot and the run state.
What it handles
- 01Shows a bell with an unread count that reads 99+ above 99 and puts the count in the button's accessible name.
- 02Opens the panel in a 400px popover on wide screens and as a full-height sheet below 640px, and NotificationPanel works alone inline.
- 03Splits the list into All, Mentions and Agents tabs, each with its own unread badge, and groups rows by day under Today and Yesterday headings.
- 04Marks one row read or unread, or all rows on the shown tab, through `onRead` and `onReadAll`; you own the read flag.
- 05Gives agent rows a bot mark, a coloured state word (Finished, Needs approval, Failed) and inline buttons that call `onAction` with the action id.
- 06Loads older items when the end of the list scrolls into view or Show older is pressed, and announces new arrivals politely but not on first render.
States
- First render
- Nothing. The bell and the list paint as they are
- none
- Hover the bell
- Background and colour change
- 120ms, ease out
- Mark read or unread
- The dot, the weight and the row tint change
- none
- Switch tab
- The list swaps to that type at once
- none
- New notification arrives
- A polite status line announces it; the row appears at once
- none
- Open the panel
- The popover or the sheet comes from its own component
- none
| State | What moves | Timing |
|---|---|---|
| First render | Nothing. The bell and the list paint as they are | none |
| Hover the bell | Background and colour change | 120ms, ease out |
| Mark read or unread | The dot, the weight and the row tint change | none |
| Switch tab | The list swaps to that type at once | none |
| New notification arrives | A polite status line announces it; the row appears at once | none |
| Open the panel | The popover or the sheet comes from its own component | none |
Works with
- PopoverInstalled with it. It holds the panel on wide screens, aligned to the bell.
- DialogInstalled with it. Below 640px the panel opens in its sheet form.
- TabsInstalled with it. The All, Mentions and Agents switch is a small tab list with badges.
- Activity feedPairs with it: share the same day grouping and relative times for the history view.
When to use
When to use
- A bell in the app header with an unread count and a list of what needs attention.
- Agent runs that wait for a person: approve from the notification without opening the run.
When not to use
- A short message that disappears on its own: use Toast.
- A permanent log of everything that happened: use Activity Feed.
Using with AI
Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:
- Add the Knowns UI Notification Center to my app and wire it to my own data.
- I need a bell in the app header with an unread count and a list of what needs attention. Set that up with the Knowns UI Notification Center.
- Which Notification Center props do I need for a minimal setup? Show me a short example.
With the server connected, your assistant calls get_component({ name: "notification-center" }) and search_docs({ query: "notification center" }).