Back to components
ElementFeedbackFree

Notification Center React component

A bell button with an unread badge that opens a notification panel: All and Unread tabs, Today and Earlier groups, unread dots, mark as read on click, mark all as read, per-item remove and full keyboard support.

About the Notification Center component

Notification Center is a bell button for an app header that opens an inbox of notifications. The bell shows the number of unread items (9+ above nine) and gives a little ring when new ones arrive. The panel lists notifications under group headings, each with an avatar or initials, who did what, an optional quote and a time, with tabs for All and Unread, a Mark all as read button and a remove button on each row.

items with onItemsChange control the list, or defaultItems lets it manage itself. Each item has an id, an actor, a title, a time label and optional body, group, avatar and read. Opening a row marks it as read and calls onItemClick, so you can navigate to it. open and onOpenChange control the panel, align lines it up with the bell's start or end edge, and title, width, emptyText and size set the rest.

When to use it

Use Notification Center in an app header to collect things that happened while someone was away: comments, invites, approvals, payouts. The badge says how many are new without interrupting, and the panel keeps them until they're read or removed.

Use a Toast Stack instead for feedback about something the person just did; those messages are fleeting, these are an inbox.

Installation

Add the Notification Center component to your project with the shadcn CLI. It lands in components/notification-center.tsx as plain React + Tailwind CSS source you own and can edit.

Install
Copied!
npx shadcn@latest add @reactframe/notification-center

Or copy the source by hand and install its dependencies:

Install
Copied!
npm install motion clsx tailwind-merge

Related components

Status Dot
Free
Toast Stack
Free
Inline Validation Message
Free
Typography Prose
Free
Toggle Pro
Free
Image Shape Mask
Free