shadcn.io is not affiliated with official shadcn/ui
Tabbed Inbox Notification Block for React
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.
Installation
Overview
Give people one place for what happened while they were away, with this notification centre for React with Base UI. A compact header holds the title and one sentence, and a hairline frame with a plus mark on each corner holds a Tabs list for All, Mentions and Alerts, each trigger with its own unread count in a quiet chip. Under it eight notifications share one row: a type tile, a title that is the row's one control, a line of detail and a fixed time. Unread is a dot, a heavier title and the word Unread for a screen reader, never a color. Pressing a title marks that row read and all three counts follow. The foot band holds a status line and two buttons: an outline Button that marks everything in the open tab read and says how many it marked, and a ghost one that clears the open tab into an Empty state with an Undo that restores exactly what it cleared. The list keeps one height in every tab and scrolls inside it. It's built from Tabs, Button, Empty and Guides, with a CSS entrance only. For a workspace inbox, an app's notification page or the panel behind a bell.
FAQ
How do I fill it with my own notifications?
Edit NOTES at the top of the file. Each has an id, a kind (mention, alert or update, which picks the tab and the icon), a title, one line of desc, an ISO at time and whether it was unread when the page opened. TABS lists the tabs, and a note shows in a tab when its kind matches (All shows every kind). Every count, the status line and the empty state are worked out from those, so nothing is typed twice. Times are written in UTC and shown against AS_OF: today as a clock time, yesterday as a word, older as a weekday and date, so the page reads the same on the server and in every time zone.
What stays local, and how do I make it real?
Read and cleared state live in the page and reset on reload; nothing is sent. To make it real, load the notifications from your API and keep read and cleared as server state. Send the ids from the title press, the Mark all read and the Clear handlers (the list the handler already builds is the one to send), and have Undo send the reverse. Pressing a title would normally open what it points to; here it only marks the row read, and says so.
Does Mark all read touch the other tabs?
It works on the open tab only, and the status line says which: "4 marked read in Mentions". Because the Mentions rows are also in All, All's count drops by the same number, and the other tab's chip is worked out again from the same list. With nothing unread in the open tab the button stays in place (it is marked unavailable rather than disabled, so it keeps focus) and answers "Nothing unread in Mentions".
What does Clear do, and how exact is the Undo?
Clear hides every notification in the open tab and shows an empty state in the same height as the list, with the number cleared and an Undo button. Undo brings back exactly those rows, with the read or unread state each had, and moves focus to the first row. Clearing from All and then opening Mentions shows that tab empty too, since its rows were cleared. Nothing is deleted anywhere.
Is it accessible?
The tabs are real tabs: Arrow keys move along them and the selection follows, Tab moves on to the panel (which scrolls by keyboard), and each trigger says how many are unread ("Mentions 2 unread"). Every row's title is a button named by its text, with "Unread" spoken first when it applies, so state never depends on the dot or the weight alone. The status line is a polite live region that is present from the start. The focus ring of a row is drawn inside it, so no neighbour clips it.
How does it look on a phone?
The panel fills the screen's width. The tab list scrolls sideways if it must, rows keep two lines (the title can wrap to a second line before the detail line), and the foot stacks the status line over the two buttons. The list is still one fixed height, so switching tabs or clearing never moves the foot.
Related
- Pro
Inbox Reading Pane Notification
Bells and panelsA shared support inbox as an app window: a list of notifications under All, Unread and Archived views, and a reading pane with the sender, the time, the text, a context list and mark read, archive and undo.
- Pro
Unread Only List Notification
Unread and countsAn 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.
- 4Pro
Mark All Read With Undo Notification
Unread and countsA 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.
- 312Pro
Grouped Accordion Notification
Sort and findNotifications grouped into Messages, Updates and Alerts in an accordion, each group with an unread count, its own mark read beside the trigger, a one-line summary when folded, and collapse and clear for the whole list.
- 5Pro
Bell Dropdown Notification
Bells and panelsThe 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.
- Pro
Preference Matrix Notification
PreferencesA notification preference matrix: five kinds of notification down the page and four channels across, a checkbox in every cell, an all-types row that turns a channel on or off, marks on changed cells and an unsaved count.