Skip to content

Notification Center

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
Used for
  • 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-center
For Claude Code, Cursor or Codex: installs it and wires the props to your own data.

Props

itemsrequired
NotificationItem[]
id, type (mention | agent | update), title, body, at (ms), read, actor, state (finished | needs-approval | failed), actions.
now
number
Defaultfirst 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
Defaultuncontrolled
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
Default3
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

  1. 01Shows a bell with an unread count that reads 99+ above 99 and puts the count in the button's accessible name.
  2. 02Opens the panel in a 400px popover on wide screens and as a full-height sheet below 640px, and NotificationPanel works alone inline.
  3. 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.
  4. 04Marks one row read or unread, or all rows on the shown tab, through `onRead` and `onReadAll`; you own the read flag.
  5. 05Gives agent rows a bot mark, a coloured state word (Finished, Needs approval, Failed) and inline buttons that call `onAction` with the action id.
  6. 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

Works with

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" }).

Need help?

Stuck on Notification Center, or found something off? We read every message.