Skip to main content
Version: 1.0.3

Notification Center

The Notification Center is a dropdown popup template anchored to a bell icon in your app shell. It supports read and unread row states, optional type and priority filters (via Settings), mark-all-as-read, per-item flag and actions, and a footer link. The template is composable: you assemble NotificationCenter with Trigger, Content, Header, Filters, List, and Footer so you can reorder sections, swap the list renderer, or wire your own state.

Ignix UI

Click the bell to open the notification popup assembled from compound parts.

Installation​

ignix add component notification-center

Usage Examples​

function AppHeaderNotifications() {
const [notifications, setNotifications] = useState<NotificationItem[]>([]);
const [open, setOpen] = useState(false);

return (
<NotificationCenter
notifications={notifications}
open={open}
onOpenChange={setOpen}
onMarkAsRead={(id) => {
setNotifications((prev) =>
prev.map((n) => (n.id === id ? { ...n, read: true } : n)),
);
}}
onMarkAllAsRead={() => {
setNotifications((prev) => prev.map((n) => ({ ...n, read: true })));
}}
>
<NotificationCenter.Trigger />
<NotificationCenter.Content>
<NotificationCenter.Header title="Notifications" />
<NotificationCenter.Filters />
<NotificationCenter.List maxHeight={400} />
<NotificationCenter.Footer label="See All Notifications" />
</NotificationCenter.Content>
</NotificationCenter>
);
}

Controlled filter state​

function FilteredNotificationCenter() {
const [filter, setFilter] = useState<NotificationCenterFilterState>({
type: "product",
priority: null,
});

return (
<NotificationCenter
notifications={notifications}
filterState={filter}
onFilterChange={setFilter}
>
<NotificationCenter.Trigger />
<NotificationCenter.Content>
<NotificationCenter.Header />
<NotificationCenter.Filters />
<NotificationCenter.List />
<NotificationCenter.Footer />
</NotificationCenter.Content>
</NotificationCenter>
);
}

Custom list with NotificationCenter.Item​

function CustomListNotificationCenter() {
return (
<NotificationCenter notifications={notifications}>
<NotificationCenter.Trigger />
<NotificationCenter.Content>
<NotificationCenter.Header />
<div className="max-h-[360px] overflow-y-auto">
{notifications.map((notification) => (
<NotificationCenter.Item
key={notification.id}
notification={notification}
/>
))}
</div>
<NotificationCenter.Footer />
</NotificationCenter.Content>
</NotificationCenter>
);
}

Features​

  • Bell trigger with unread badge count
  • Read / unread row styles for quick scanning
  • Type filters (product, system, user) and priority filters (low → critical) via Settings
  • Mark all as read in the panel header
  • Per-item flag and overflow actions menu
  • Timestamp and source metadata on each row
  • Compound sections you can reorder or replace (header, filters, list, footer)

Props​

NotificationCenter (root)​

PropTypeDescription
notificationsNotificationItem[]Full notification list; filtering is applied internally from filterState.
childrenReactNodeCompound tree: typically Trigger + Content with nested sections.
openboolean (optional)Controlled open state for the dropdown panel.
onOpenChange(open: boolean) => void (optional)Called when the panel opens or closes.
filterStateNotificationCenterFilterState (optional)Controlled type / priority filter.
onFilterChange(next: NotificationCenterFilterState) => void (optional)Called when filters change in Settings.
onMarkAsRead(id: string) => void (optional)Mark a single notification as read.
onMarkAllAsRead() => void (optional)Mark every notification as read.
onToggleFlag(id: string) => void (optional)Toggle the flagged state for an item.
onSeeAll() => void (optional)Footer link handler; panel closes after click.
onSettings() => void (optional)Settings control in the header (e.g. open filter UI).
classNamestring (optional)Extra classes on the root wrapper.

NotificationCenter.Trigger​

PropTypeDescription
classNamestring (optional)Extra classes on the bell button.

NotificationCenter.Content​

PropTypeDescription
childrenReactNodePanel body (header, filters, list, footer).
classNamestring (optional)Extra classes on the popover panel.

NotificationCenter.Header​

PropTypeDescription
titlestring (optional)Panel title; defaults to "Notifications".

NotificationCenter.Filters​

PropTypeDescription
classNamestring (optional)Wrapper classes when the filter strip is visible.

NotificationCenter.List​

PropTypeDescription
classNamestring (optional)Classes on the scrollable list container.
maxHeightnumber (optional)Max height in pixels for the list viewport.

NotificationCenter.Item​

PropTypeDescription
notificationNotificationItemRow data for a single notification.

NotificationCenter.Footer​

PropTypeDescription
labelstring (optional)Footer link text; defaults to "See All Notifications".

NotificationItem​

FieldTypeDescription
idstringStable identifier.
type"product" | "system" | "user"Category for filtering and iconography.
priority"low" | "medium" | "high" | "critical"Triage level.
titlestringPrimary line.
messagestringSupporting copy.
readbooleanWhether the item has been read.
createdAtDateUsed for relative timestamps.
sourcestring (optional)Shown beside the timestamp (e.g. module name).
contextLabelstring (optional)Extra label when needed.
flaggedboolean (optional)Bookmark / flag state.

Notes​

  • Keep notification state in your app store or API layer; pass notifications and update via onMarkAsRead, onMarkAllAsRead, and onToggleFlag.
  • Use controlled open and filterState when the panel must sync with routing or parent layout.
  • NotificationCenter.List renders all filtered items by default; swap in a custom map of NotificationCenter.Item when you need virtualized or grouped lists.