NotificationBell
Feedback

NotificationBell

Bell trigger with an unread badge. Pair with InboxPanel inside a PopoverPanel.

Props

NotificationBell extends HTMLAttributes<HTMLButtonElement> and uses forwardRef so it can anchor a PopoverPanel.

NotificationBellProps props
PropTypeDefaultDescription
countnumber0Number of unread notifications.
maxnumber9Counts above this render as "9+".
dotboolean—Displays a dot instead of the unread count.

Examples

No count

NotificationBell (no count)

With count

NotificationBell (with count)

Overflow

NotificationBell (overflow)

Dot only

NotificationBell (dot)

Custom max

NotificationBell (custom max)
ImportTSX
import { NotificationBell, PopoverPanel, InboxPanel } from "@solarius/onset";

<PopoverPanel
  trigger={<NotificationBell count={unreadCount} />}
  placement="bottom-end"
>
  <InboxPanel items={notifications} onRead={markRead} onDismiss={dismiss} />
</PopoverPanel>;