Notification Center
Bell-trigger inbox with unread badge and a scrollable list.
Import
tsx
import { NotificationCenter, NotificationList, NotificationRow } from "@cronus-ui/ui";
bash
npx cronus-ui add notification-center
Examples
.cronus
The same component declared in Cronus. Emitted at build time from the audit fixtures — the kernel renders it as HTML with no React.
default.cronus
app "audit-fixtures" {
port 5176
}
style {
preset aurora
theme dark
}
component NotificationCenterDefault layout:inline style:notification-center {
label "Notifications"
text "New comment"
text "Payout sent"
}
page "/audit/notification-center/default" type:custom {
use NotificationCenterDefault
}
API Reference
Generated from the component's exported types.
NotificationRowProps
Extends Omit<HTMLAttributes<HTMLButtonElement>, "id" | "title" | "onClick" | "onSelect">
| Prop | Type | Default | Description |
|---|---|---|---|
notification* | NotificationItem | — | — |
onSelect | (id: string) => void | — | Fired with the notification id when the row is activated. |
className | string | — | Additional class names merged onto the root. |
children | ReactNode | — | Contents of the component. |
NotificationListProps
Extends Omit<HTMLAttributes<HTMLDivElement>, "onSelect">
| Prop | Type | Default | Description |
|---|---|---|---|
notifications* | readonly NotificationItem[] | — | — |
onSelect | (id: string) => void | — | Fired with the notification id when a row is activated. |
emptyState | ReactNode | — | Replaces the built-in "You're all caught up" empty state. |
className | string | — | Additional class names merged onto the root. |
children | ReactNode | — | Contents of the component. |
id | string | — | DOM id of the root element. |
NotificationCenterProps
Extends Omit<ComponentPropsWithoutRef<typeof PopoverContent>, "onSelect" | "title">
| Prop | Type | Default | Description |
|---|---|---|---|
notifications* | readonly NotificationItem[] | — | Items to display in the inbox. |
onMarkAllRead | () => void | — | Fired when the "Mark all read" affordance is activated. |
onNotificationClick | (id: string) => void | — | Fired with the notification id when a row is activated. |
title | ReactNode | "Notifications" | Header heading text. |
emptyState | ReactNode | — | Custom empty-state content (defaults to "You're all caught up"). |
footer | ReactNode | — | Optional footer rendered below the list (e.g. a "View all" link). |
className | string | — | Class names for the popover panel. |
asChild | boolean | — | Render as the child element via Slot. |
children | ReactNode | — | Contents of the component. |