A bell whose unread ball grows into a panel of alerts, mentions and approvals, with swipe to archive, rolling counts and group tabs.
Click meTap me
notification-center, lively
Use it for the bell in an app's top bar: deploy results, mentions, approvals waiting on someone, anything the person should see but that must not interrupt them. It holds a list the person works through (read, archive, filter). For one message that appears and goes, pick the toast; for a status next to a record, the status badge; for a full history page, the inbox preset of this component.
The motion follows the three beats. Pressing the bell charges: it sinks under the finger. On release it acts: the unread ball at its corner grows into the 360 px panel, wearing the ball's colour on its first frames and turning into the popover surface as it lands, corners easing from 9 to 16 px, never bouncing. The ball's digits travel and become the header's "3 unread" pill. It settles as the header, the group tabs and the rows rise in one cascade while the surface still grows: whatever the surface already holds shows at once, and its moving edge fades what it crosses instead of cutting a line of text. Closing, the content fades under the shrinking edges as the ball's colour comes back, so the surface reaches the bell as the ball, never as an empty block. An archived row squashes to nothing while its siblings close ranks on a calm spring and the count rolls down; a new notification kicks the ball and swings the bell. calm drops the kick and the bounce, playful lets the rows rise with more spring; the look never changes.
pnpm dlx shadcn@latest add @motionkit-pro/notification-centernpx shadcn@latest add @motionkit-pro/notification-centeryarn dlx shadcn@latest add @motionkit-pro/notification-centerbunx --bun shadcn@latest add @motionkit-pro/notification-centerRequires a Pro license and the @motionkit-pro registry with your token. See Installation.
import { NotificationCenter, type NotificationData } from "@/components/ui/notification-center"
export function TopBarBell({ initial }: { initial: NotificationData[] }) {
const [items, setItems] = useState(initial)
return (
<NotificationCenter
items={items}
onRead={(ids) =>
setItems((all) =>
all.map((item) => (ids.includes(item.id) ? { ...item, read: true } : item)),
)
}
onArchive={(id) => setItems((all) => all.filter((item) => item.id !== id))}
onItemClick={(item) => router.push(`/events/${item.id}`)}
/>
)
}Each item is { id, title, description?, time, kind?, read?, href? }; kind is info, success, warning or mention and picks the tone of the row's 20 px ball. Pass items (controlled, update them from onRead and onArchive) or defaultItems. Adding an unread item to items is the app event: the badge is kicked, the count rolls up and the arrival is announced. groups replaces the All / Unread / Mentions tabs ({ id, label, filter }). open / onOpenChange control the panel; align places it under the bell (end by default).
For custom parts, compose them: NotificationTrigger (the bell; asChild for your own button, the badge stays at its corner), NotificationPanel (title, renderItem for your own row content inside the row's shell, empty, and every Radix Popover content prop such as onInteractOutside), NotificationItem and NotificationEmpty.
<NotificationCenter items={items} onRead={markRead} onArchive={archive}>
<NotificationTrigger />
<NotificationPanel title="Activity" empty={<NotificationEmpty title="Nothing new" />} />
</NotificationCenter>Pick a layout with preset: panel (default; below 640 px it becomes a bottom sheet, full width minus 16 px gutters and at most 70% of the viewport's height, grown out of the same ball), inbox (a page list with the groups in a left column, no bell and no morph; the column becomes a row of tabs under 560 px) or tray (resting the pointer on the bell fans the three newest rows under it; a click opens the panel). Set the character app-wide with MotionKitProvider, or here with temperament.
Prop
Type
Prop
Type
Also accepts all props of ComponentProps<"button">.
Prop
Type
Also accepts all props of Omit<
ComponentProps<typeof PopoverPrimitive.Content>,
"forceMount" | "asChild" | "children"
>.
Prop
Type
Prop
Type
Also accepts all props of ComponentProps<"div">.
Prop
Type
The inbox preset as the /notifications page of the same console: groups on the left with the travelling highlight, the same rows, swipe and actions. Switching group cascades the rows in again.
Click meTap me
notification-center, lively
The tray preset: resting on the bell fans the three newest rows as peeking tiles, the notification-stack gesture; clicking opens the full panel.
Click meTap me
Open tickets · 12
Waiting on customer · 4
notification-center, lively
button named "Notifications, 3 unread" with aria-haspopup="dialog" and aria-expanded; the badge, its travelling digits, the morph's flying copy, the kind balls and the swipe target are aria-hidden.role="dialog" named by its title. Focus moves to the first group tab when the person opens it, Tab stays inside the panel, Escape closes it and focus returns to the bell at once while the panel contracts. Opened from the open prop (a demo, a deep link) it does not take focus.tablist with arrow-key navigation and a tabpanel; the rows are a list, each row's title a button (or a link with href) whose focus halo is drawn around the whole tile.tray, the fanned tiles are a hover preview only (aria-hidden): keyboard and touch open the full panel, which holds the same rows.primary-foreground on primary; row text is foreground and muted-foreground on popover, AA in both themes. ring is used for focus only; unread state is primary.| Key | Action |
|---|---|
Enter / Space on the bell | Opens the panel out of the unread ball; focus moves to the first group tab |
← / → on the tabs (↑ / ↓ in the inbox column) | Moves between groups and filters the list |
Tab / Shift+Tab | Moves through tabs, rows and each row's buttons; focus stays inside the panel |
Delete / Backspace on a row | Archives the row; focus moves to the next row |
Escape | Closes the panel; focus returns to the bell while the panel contracts |
With reduced motion (the OS setting, or MotionKitProvider reducedMotion="always") nothing sinks, kicks or morphs: the panel crossfades in under the bell with its header, tabs and rows all at once, an archived row fades while its siblings close ranks in the fade's time, the digits crossfade instead of rolling, a swipe follows the finger 1:1 and the tray's tiles fade in at their place. The open panel is the same picture as the morph's last frame.
transform), its rim counter-scaled so it stays 1 px; rows rise, squash and reflow with transform and opacity. The swipe writes one motion value per pointer move, no React render.@radix-ui/react-popover and motion, shared with the popover, the combobox and the date picker.Main spring of each temperament. Set it with the temperament prop or MotionKitProvider; the default is lively.
Not measured yet · budget 15.0 kB gzip
Component and MotionKit helpers; excludes react, react-dom, @radix-ui/react-popover, motion.
click, drag, hover
No kick, no morph and no stretch: the panel crossfades in under the bell with every row at once, an archived row fades while its siblings close ranks in the fade's time, and a swipe follows the finger 1:1.
Last 2 versions of Chrome, Edge, Firefox and Safari (iOS 16.4+)