Notification Panel
ProThe content of a notifications dropdown: a header with Mark all as read, All and Unread tabs, rows with an avatar, message, time and unread dot, and a footer link.
Playground
Notifications
- PRCan you confirm the launch date?5m agoUnread
- Free up space to continue uploading.40m agoUnread
- DOQ4-planning.pdfYesterday
- Your analytics summary is available.Nov 12
Installation
Notification Panel comes with WunderUI Core and Pro, in the package from your plan. See the plans.
Then import what you need:
import {
NotificationPanel,
NotificationPanelItem,
NotificationPanelProps,
} from "@wunderui/react"Then use it:
import { NotificationPanel } from "@wunderui/react"
export function Notifications() {
return (
<NotificationPanel
items={[
{ id: "n1", avatar: { initials: "PR" }, title: "Priya Raman mentioned you", description: "Can you confirm the launch date?", time: "5m ago", unread: true },
]}
/>
)
}Expected result: You should see the title Notifications with Mark all as read, the All and Unread tabs, one row with an avatar, the message, 5m ago and an indigo dot, and the View all notifications link.
When to use
Use Notification Panel for
- The dropdown or sheet that a bell in the top bar opens
- A short, recent list with a read and unread state
- A list that ends in a link to the full notification page
Use something else for
- List Panel for a dashboard card that lists rows, with its own title, states and footer button
- Toast for a message that appears for a moment and leaves by itself
- Popover for any other content that opens from a button
Tabs
All and Unread are a fit-content segmented control, and Unread shows how many are waiting. Hide them with hideTabs when the list is short.
Tabs
Notifications
- PRCan you confirm the launch date?5m agoUnread
- Free up space to continue uploading.40m agoUnread
- DOQ4-planning.pdfYesterday
- Your analytics summary is available.Nov 12
Without tabs
Notifications
- PRCan you confirm the launch date?5m agoUnread
- Free up space to continue uploading.40m agoUnread
- DOQ4-planning.pdfYesterday
Empty
With nothing to show the panel says so, and Mark all as read is disabled while nothing is unread.
Notifications
You're all caught up
New notifications will show up here.
Behavior and motion
What the panel does with its tabs, its rows and the read state.
- Read state
- The panel does not store anything. Each item says whether it is unread, and onMarkAllRead and onItemSelect tell you to change your data.
- Tabs
- All shows every item and Unread only the unread ones. The tab is its own state, or controlled with tab and onTabChange. The Unread counter is the number of unread items.
- Rows
- A row is one button that runs the item onSelect and then onItemSelect. The unread dot keeps its space when the row is read, so marking it never shifts the text.
- Empty
- With nothing to show the panel says You are all caught up on the Unread tab, or No notifications yet on All, and Mark all as read is disabled while nothing is unread.
- Motion
- The tab pill slides and the dot fades, with the motion tokens. With reduced motion both switch at once.
Anatomy
The panel is a column of four parts. It has no border or shadow, so the popover or card around it draws the surface.
- data-slot="notification-panel"
The panel without a surface: put it in a PopoverContent with p-0, a Sheet or a card. It is a section named by its title.
- data-slot="notification-panel-header"
The title, 16 px semibold, and Mark all as read as a link button on the right. The button is disabled while nothing is unread.
- data-slot="notification-panel-tabs"Optional
All and Unread as a small segmented control, as wide as its labels. Unread carries a counter. Hide it with hideTabs.
- data-slot="notification-panel-rows"
One list row per notification: an avatar or an icon tile, the title, the message, the time and an unread dot that keeps its space. Long titles wrap, nothing is cut. The rows scroll after 24 rem.
- data-slot="notification-panel-footer"Optional
A link under a separator, View all notifications. Pass footer={false} to hide it.
Best practices
- Do
Put it in a PopoverContent with p-0 and a width of about 24 rem (w-96). On a phone put it in a bottom Sheet instead.
- Do
Keep the unread state in your data and mark a row read when it is pressed, so the dot, the Unread tab and the bell count agree.
- Do
Write the message so it reads without the avatar: who did what, then the detail in the description.
- Don’t
Do not put approvals or forms in the rows. A row opens the item; the decision belongs on its page.
- Don’t
Do not make the tabs full width. They end with the last tab.
API reference
NotificationPanel is a plain component, so the table lists every prop. A row is a NotificationPanelItem.
The panel without a surface: put it in a PopoverContent with p-0, a Sheet or a card. It is a section named by its title.
| Prop | Type | Default | Description |
|---|---|---|---|
| items required | NotificationPanelItem[] | — | The notifications: id, title, description, time, an avatar (initials, src, color) or an icon, unread and onSelect. |
| onMarkAllRead | () => void | — | Runs from Mark all as read. The button is disabled while no item is unread. |
| onItemSelect | (item) => void | — | Runs when a row is pressed, after the item onSelect. |
| tab | "all" | "unread" | — | The tab shown, all or unread, when you control it. Use it with onTabChange. |
| defaultTab | "all" | "unread" | "all" | The tab shown first when the panel keeps its own state. Default all. |
| hideTabs | boolean | — | Hides the All and Unread tabs. |
| footer | { label?: ReactNode; href?: string; onClick?: MouseEventHandler<HTMLElement> } | false | {} | The footer link as label, href and onClick. With an href it is a link, without one a plain button. Pass false to hide it. |
| title | ReactNode | "Notifications" | The heading. Default Notifications. |
| maxRowsHeight | string | "24rem" | How tall the rows grow before they scroll. Default 24rem. |
| onTabChange | (tab) => void | — |
Notes for AI
Give your coding assistant the Markdown reference instead of screenshots.
get_component("notification-panel")The full library index for assistants is at /llms.txt.
Related components
Recent transactions
Last 7 days
- NLNora LindgrenWunderUI Pro, one-time+$299.00Today
- DODaniel OkaforWunderUI Core, one-time+$199.00Yesterday
- PRPriya RamanWunderUI Pro, refund-$49.00Nov 4
Data & Tables7 stylesProList PanelA dashboard card with a titled list: 31 ready panels (transactions, orders, integrations, team, activity, crypto, timelines …) with loading, empty and error states, or your own rows.