Notification Center for React
A React notification center: a bell with a live unread count that opens a glass inbox with tabs, day groups and inline actions.
npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/notification-center.jsonNotificationCenterNotificationPaneldefaultNotificationLabelsdefaultNotificationCenterLabels- +2 more
Bell and inbox
Open the bell, then try “Simulate a notification”: the bell rings, the count pops and the new row glows once. Hover a row for its actions, accept the invite, or press Delete on a focused row (Undo or ⌘Z / Ctrl+Z brings it back). On a phone the inbox opens as a sheet from the bottom of the screen.
import { useState } from "react";
import { NotificationCenter } from "@/components/sheenui/blocks/notification-center";
import { type NotificationItem } from "@/components/sheenui/blocks/notification-center/model";
// Package build (after the first npm release, or a packed tarball): import { NotificationCenter, type NotificationItem } from "@sheenui/theme";
const router = { push: (to: string) => window.location.assign(to) };
const api = {
deleteNotification: (id: string) => fetch("/api/notifications/" + id, { method: "DELETE" }),
};
export function Example() {
const [items, setItems] = useState<NotificationItem[]>([
{
id: "n1",
kind: "mention",
actor: { name: "Ada Lovelace", avatar: "/ada.jpg" },
title: <><b>Ada Lovelace</b> mentioned you in <b>Q3 roadmap</b></>,
description: "“@you could you sanity-check the contrast numbers?”",
time: "2026-10-30T09:41:00Z",
href: "#demo-q3-roadmap-c12",
},
// …
]);
return (
<NotificationCenter
notifications={items}
onNotificationsChange={setItems}
onSelect={(n) => {
if (n.href) router.push(n.href);
}}
// Delete on the server once Undo is no longer possible.
onDismissCommit={(n) => api.deleteNotification(n.id)}
viewAllHref="/notifications"
/>
);
}Files to copy
13 folders · 16 files · 4 packages
- From
theme/src/ blocks/notification-center.tsxcomponents/avatar/components/button/components/empty-state/components/kbd/components/spinner/components/tabs/components/tooltip/blocks/notification-center/hooks/{use-controllable.ts, use-direction.ts, use-latest.ts, use-magnetic.ts, use-media-query.ts, use-preferences.ts}motion/{gate.ts, tokens.ts}lib/{cn.ts, form.ts, heading.ts, initials.ts, popup-motion.ts, state-light.tsx, warn-once.ts}styles/
- shadcn CLI
npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/notification-center.jsonRegistry item: notification-center. The styles need the Tailwind v4 glass UI setup.- Packages
pnpm add @base-ui/react clsx motion tailwind-merge
Inline panel
NotificationPanel is the same inbox without the bell, as a glass card for a notifications page, a drawer or a dashboard column. Add your own header controls next to “Mark all as read”.
import { NotificationPanel } from "@/components/sheenui/blocks/notification-center";
import { type NotificationItem } from "@/components/sheenui/blocks/notification-center/model";
import { Button } from "@/components/sheenui/button/button";
// Package build (after the first npm release, or a packed tarball): import { NotificationPanel, Button, type NotificationItem } from "@sheenui/theme";
const items: NotificationItem[] = [
{
id: "n1",
kind: "mention",
actor: { name: "Ada Lovelace" },
title: <><b>Ada Lovelace</b> mentioned you in <b>Q3 roadmap</b></>,
description: "“@you could you sanity-check the contrast numbers?”",
time: "2026-10-30T09:41:00Z",
},
{ id: "n2", kind: "success", title: "Deploy finished", time: "2026-10-30T08:12:00Z", read: true },
];
export function Example() {
return (
<NotificationPanel
defaultNotifications={items}
defaultTab="unread"
viewAllHref="/notifications"
headerActions={
<Button variant="ghost" size="icon" aria-label="Notification settings" render={<a href="#demo-settings-notifications" />}>
<svg aria-hidden viewBox="0 0 24 24" className="size-4" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round">
<circle cx="12" cy="12" r="3" />
<path d="M12 3v3M12 18v3M3 12h3M18 12h3M5.6 5.6l2.1 2.1M16.3 16.3l2.1 2.1M18.4 5.6l-2.1 2.1M7.7 16.3l-2.1 2.1" />
</svg>
</Button>
}
className="h-[30rem]"
/>
);
}Any language
Every string is a label, and day headings and times come from Intl for the locale: Heute, Gestern, then weekdays. Mark everything read on the Ungelesen tab to reach the empty state.
Mitteilungen
import { NotificationPanel } from "@/components/sheenui/blocks/notification-center";
import { type NotificationItem } from "@/components/sheenui/blocks/notification-center/model";
// Package build (after the first npm release, or a packed tarball): import { NotificationPanel, type NotificationItem } from "@sheenui/theme";
const items: NotificationItem[] = [
{
id: "n1",
kind: "mention",
actor: { name: "Ada Lovelace" },
title: <><b>Ada Lovelace</b> hat Sie in <b>Q3-Fahrplan</b> erwähnt</>,
description: "“@you kannst du die Kontrastwerte prüfen?”",
time: "2026-10-30T09:41:00Z",
},
{ id: "n2", kind: "success", title: "Deployment abgeschlossen", time: "2026-10-30T08:12:00Z", read: true },
];
export function Example() {
return (
<NotificationPanel
defaultNotifications={items}
locale="de-DE"
labels={{
title: "Mitteilungen",
markAllRead: "Alle gelesen",
all: "Alle", unread: "Ungelesen", mentions: "Erwähnungen",
today: "Heute", yesterday: "Gestern",
emptyUnreadTitle: "Alles erledigt",
// …every other string
}}
/>
);
}NotificationCenter
NotificationCenterLabels keys and English defaults (30)
NotificationItem
NotificationPanel
Keyboard
Accessibility
- The bell is named “Notifications, 3 unread” and the count is text; the panel is a labeled popover.
- Dismissals (with the undo shortcut), arrivals and “all read” are announced politely.
- Swipe-to-dismiss on touch always has the dismiss button as an alternative.
All exports on this page
NotificationCenter— Props (see NotificationCenterProps): the shared inbox props (notifications / defaultNotifications / onNotificationsChange, onSelect, onDismiss, onRestore, onDismissCommit, viewAllHref, headerActions, defaultTab ("all"), now, locale, labels, headingLevel (2)) plus open / defaultOpen (false) / onOpenChange, side ("bottom"), align ("end"), max (99), className (the bell) and panelClassName.NotificationPanel— The inbox as an inline glass card (no bell): for a page, a drawer or a dashboard column.defaultNotificationCenterLabels— The English NotificationCenterLabels used when labels is omitted; a partial labels prop is merged over them.defaultNotificationLabels— The former name of defaultNotificationCenterLabels, kept as an alias for one release.
When to use the notification center
- Use NotificationCenter as a notification dropdown for the bell in an app header, where an unread count badge opens a popover inbox with All, Unread and Mentions tabs and, with viewAllHref, a link to view everything.
- Use NotificationPanel for a dashboard column or a drawer that shows the inbox inline, giving it a height with className because it defaults to 32rem.
- Use it when dismissals need a safety net, since Delete removes a notification, an undo bar appears, and Ctrl or Cmd plus Z restores it.
- Skip it when you only need a brief confirmation such as "Saved"; a Toast fits transient messages better than a persistent inbox with read state and tabs.
- Pair it with Avatar for sender images, Tooltip for the header actions, and KbdShortcut to teach the undo shortcut, passing items through notifications or defaultNotifications.
Frequently asked questions
Related pages
20 blocks pages in all: browse them on All blocks.
By Lokendra Singh Rathore (GitHub, opens in a new tab). Published , updated .