Notification CenterProv1.0.0
A bell with a live unread count that opens your updates, grouped by when they happened and filtered to All, Unread or Mentions. Opening one marks it read; Mark all read clears the lot. The list also works on its own, for a notifications page or a sidebar.
pnpm dlx shadcn@latest add @beautiful-ui-pro/lumen-notification-centerNeeds your registry key. Your components.json style picks the Base UI or Radix build: radix-*, new-york and default get Radix, base-* gets Base UI.
Styles didn't apply?
The CLI adds the styles to the CSS file named in components.json (tailwind.css). Check that it points at your global stylesheet, that the project uses Tailwind CSS v4, and that the file is imported in your root layout. Installed by hand: paste styles.css into that file.
Usage
Import it and pass your content. The props that matter most are listed next.
"use client";
import * as React from "react";
import { useRouter } from "next/navigation";
import { NotificationCenter, type Notification } from "@/components/ui/lumen/blocks/notification-center";
export function HeaderBell({ initial }: { initial: Notification[] }) {
const router = useRouter();
const [items, setItems] = React.useState(initial);
return (
<NotificationCenter
notifications={items}
onNotificationsChange={(next) => {
setItems(next);
const read = next.filter((n) => n.read).map((n) => n.id);
void fetch("/api/notifications/read", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ ids: read }) });
}}
onItemClick={(n) => n.href && router.push(n.href)}
/>
);
}Props
notifications / defaultNotifications / onNotificationsChange–Notification[] / Notification[] / (next) => voidNotification = { id, actor, message, time, group?, read?, mention?, preview?, avatarUrl?, href? }. Controlled or not; read state changes come back through onNotificationsChange.
onItemClick–(item) => voidA row was opened (it's marked read first). Route with item.href.
filter / defaultFilter / onFilterChange"all""all" | "unread" | "mentions"The tab.
open / defaultOpen / onOpenChange–boolean / boolean / (open) => voidNotificationCenter: the panel, controlled or not.
align"end""start" | "center" | "end"NotificationCenter: where the panel opens from the bell.
maxListHeight380numberThe list's largest height before it scrolls.
Show all 7 propsShow fewer
labels–Partial<NotificationLabels>Every word, for i18n: title, filters, empty lines, the bell's name bell(unread).
Source
components/ui/lumen/blocks/notification-center.tsx
This component is included with Pro.
Try the live preview above. Get Pro to install the source.