Notification Center

Notification bell, list, and item display

SaaSNotifications

Overview

NotificationCenter provides a dropdown panel triggered by a notification bell icon with unread count badge. It displays a scrollable list of notifications with variant-based styling (info, success, warning, destructive), read/unread states, and actions for marking as read and deleting. Supports loading and error states.

Usage

import { NotificationCenter } from '@leanicon/web-builder-library/saas'

;<NotificationCenter
  notifications={[
    {
      id: '1',
      title: 'Deployment succeeded',
      description: 'v2.4.1 deployed.',
      variant: 'success',
      isRead: false,
      timestamp: new Date(),
      category: 'CI/CD',
    },
    {
      id: '2',
      title: 'Storage warning',
      description: '90% of quota used.',
      variant: 'warning',
      isRead: true,
      timestamp: new Date(),
      category: 'System',
    },
  ]}
  isOpen={true}
  onOpenChange={(open) => setOpen(open)}
  onNotificationClick={(n) => router.push(n.actionUrl)}
  onMarkAsRead={(id) => markRead(id)}
  onMarkAllAsRead={() => markAllRead()}
  onDelete={(id) => deleteNotification(id)}
  permissions={{ canDeleteNotifications: true, canMarkAsRead: true }}
/>

Variants

Default

Empty

Loading

With Error

Props

NameTypeDefaultRequiredDescription
notificationsNotification<TMetadata>[]—YesList of notifications to display
isOpenboolean—YesWhether the panel is open
onOpenChange(open: boolean) => void—YesCallback to toggle panel
onNotificationClick((notification: Notification<TMetadata>) => void)—NoCallback when a notification is clicked
onMarkAsRead((id: string) => void)—NoCallback to mark a notification as read
onMarkAllAsRead(() => void)—NoCallback to mark all notifications as read
onDelete((id: string) => void)—NoCallback to delete a notification
isLoadingbooleanfalseNoLoading state
errorstring—NoError message to display
permissionsNotificationCenterPermissions—NoPermission flags
triggerReactNode—NoCustom trigger element (defaults to NotificationBell)
portalContainerHTMLElement | null—NoElement to mount the Radix Popover portal into. Defaults to `document.body`. Use this to scope the popover inside a parent container (e.g. a docs preview frame or a modal with its own portal root) instead of letting it render at the document root.
classNamestring—NoAdditional CSS class names