Ballmac UI home

Notification Center

A bell with an unread badge that opens grouped notifications with All and Unread views, mark-as-read, dismiss, and an unread count in its accessible name.

Installation

$ pnpm dlx shadcn@latest add @ballmac/notification-center

Usage

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

The full example is in the Code tab above.

Examples

Empty

API reference

PropTypeDefault
notifications*

Notifications, newest first.

NotificationItem[]—
onMarkRead

Called when one is marked read (by opening it or with the check button).

(id: string) => void—
onMarkAllRead

Called by "Mark all as read".

() => void—
onDismiss

Adds a dismiss button on each row.

(id: string) => void—
onOpenItem

Called when a row is chosen.

(item: NotificationItem) => void—
open

Open state, for controlled use.

boolean—
defaultOpen

Initial open state.

boolean—
onOpenChange

Called when the panel opens or closes.

(open: boolean) => void—
label

Accessible name of the bell button. The unread count is added.

string—
emptyText

Message when there is nothing to show.

string—
align

Side of the bell the panel opens on.

"start" | "center" | "end""end"

Also accepts the standard attributes of its root element.

Accessibility

KeyAction
Enter / SpaceOpens the panel; Escape closes and restores focus
Screen readersThe button announces the unread count; unread rows include 'Unread'; the list is a polite live region
TabRow actions appear on hover and on keyboard focus

Use with AI

notifications[] with {id,title,description,time,group,read,icon,href}. Handle onMarkRead, onMarkAllRead, onDismiss and onOpenItem in your own state. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI Notification Center (@ballmac/notification-center) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • App headers
  • In-app activity and alerts

Not for

  • Transient confirmations; use toast
  • Long-form updates; use changelog-feed

Registry JSON: https://ui.ballmac.com/r/notification-center.json

Credits

Free to use in personal and commercial projects.