Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Bell Dropdown Notification Block for React

The list under a CRM's notification bell, shown open under its top bar: five notifications that mark themselves read when pressed, a bell whose count and name go down with them, Mark all read and See all.

Framework
UI library

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

Show the latest notifications from the bell in your app's top bar, with this bell dropdown for React with Base UI. It's the bell of Bellcairn, a CRM: a drawn page (a search sketch, a nav column, three stat tiles and four deals) in a hairline frame with a plus mark on each corner, under a top bar that holds the real bell. The list under the bell has five notifications, each with a type tile, a title that is the row's one control, one line of detail and a fixed time. Unread is a dot, a heavier title and the word "Unread" for a screen reader, never a colour. Pressing a row marks it read and the Badge on the bell counts down; "Mark all read" clears the rest, and "See all notifications" says it leads to a page of your own. The bell's name follows the count ("Notifications, 3 unread") and its badge stops at "99+". For preview the list is drawn open in place when the page loads; the bell opens the real Popover, which is not modal, with the same rows and the same state. It's built from Popover, Button, Badge and Guides, with a CSS entrance only. For a CRM, an admin console or any app with a bell in its header.

FAQ

Why is the list already open, and what do I keep?

So you can see it without a click. On load the list is a copy drawn in place under the bell: a native dialog element that isn't modal, so nothing is trapped, hidden or focused, and the page around the preview keeps working. Pressing the bell opens the real Popover with the same BellBody and the block's state, so what you marked read in place is read in the real one, and the copy stays closed until a reload. In your app keep the Popover and drop the copy: the "in-place" state, its dialog and the Escape effect. The popover is not modal by default and opens under the bell, aligned to its end.

What stays local, and how do I make it real?

Read state lives in the block and resets on reload: nothing is saved, and "See all notifications" only says it leads to a page of your own. To make it real, replace NOTES with your API's list, send the id from open to your server when a row is pressed (and the ids from markAll), and make See all a link to your notifications page. The count is worked out from the list, so it follows whatever you load.

How do the bell's name and count work?

The unread count is worked out from NOTES and what has been read, never typed. The badge is hidden from a screen reader; the bell's own name carries the same fact ("Notifications, 3 unread", or "Notifications, nothing unread"), so it is read the way it looks. From 100 unread the badge says "99+" (shownOf), and the name keeps the real number. A dot and a heavier title mark an unread row, and a screen reader hears "Unread" before its title.

Is it usable with a keyboard and a screen reader?

Yes. The bell is a button, each row's title is a button that marks it read, and Mark all read and See all notifications are buttons. In the real popover Escape closes it and returns focus to the bell, and focus moves into the list when it opens. The copy shown on load moves no focus; Escape inside it closes it and puts focus on the bell. One polite status message says what each press did.

How do I use my own notifications?

Edit NOTES at the top of the file. Each has an id, a kind (message, deal, task, assign or import, which picks the icon), a title, a desc, an ISO at time and whether it was unread. Times are shown against AS_OF: today as a clock time, yesterday as a word, older as a weekday and date, so the preview reads the same every day.

How does it look on a phone?

The list hangs from the bell at the end of the top bar and is as wide as the page minus a margin; the avatar in the bar goes away to make room, and each row keeps one height with its title on up to two lines. The real popover is as wide as the screen minus a margin.

  • Pro

    A UI kit's count badge drawn on three header buttons: a number field sets the bell, a toggle switches number and dot, and each cell prints what is shown and what a screen reader hears.

  • Pro

    A notifications panel that slides in from the end of a sales pipeline's page, open on load: a bell that toggles it, five rows that mark themselves read, and Clear all with an exact Undo.

  • Pro

    A notification centre as a narrow panel: tabs for All, Mentions and Alerts with their own unread counts, rows you press to mark read, a mark all read for the open tab and a clear with an undo.

  • Pro

    An inbox with an unread-only switch and a live count, where a row you read stays in place until you turn the switch off, and zero unread is a designed Inbox zero state.

  • Pro

    A summary band with a rolling unread count and a mark all read that fades the dots in turn and offers an exact undo, over a list where every row can be marked unread again.

  • Pro

    Snooze Notification

    Quiet and digests

    A notification with a snooze popover: Later today, Tomorrow and Next week worked out from one fixed time, a custom hour, a Snoozed list with wake times and a Wake now that sends one back.