Patterns · Feedback
NotificationCenter
Since v6.6.0
A bell with an unread count that opens the notification list.
import { NotificationCenter } from '@nexub/patterns';Examples
Inbox
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| notificationsrequired | NotificationCenterItem[] | — | Newest first. Your app owns them and their read state. |
| onOpen | ((id: string) => void) | — | A notification was opened; mark it read here. |
| onDismiss | ((id: string) => void) | — | Shows a dismiss button per item. |
| onMarkAllRead | (() => void) | — | Shows "Mark all as read" while some are unread. |
| emptyText | React.ReactNode | — | Shown with no notifications. |
| className | string | — | |
| emptyState | React.ReactNode | — | Shown when there are no notifications, in place of emptyText. |
| errorState | React.ReactNode | — | Shown in place of the list; wins over loading and emptyState. |
| loading | boolean | — | 10.5: shows skeleton rows in place of the list and sets aria-busy on the panel. |
| sheet | false | true | 'auto' | 'auto' (pass `sheet={false}` to keep a popover on small screens) | 10.6: on phones the panel opens as a bottom sheet (true, or 'auto' to let the component decide). |
On iOS & Android
Web only
NotificationCenter has no @nexub/react-native twin. On phones, follow the platform pattern instead, or compose it from the native components listed on the React Native page.