Notification Bell
Overview
A bell button that swings on new notifications with a rolling unread badge.
This feedback component is intended for interfaces that need a bell button that swings on new notifications with a rolling unread badge, form workflows, and support tools. Its implementation is provided as editable source so the final behavior and styling stay inside your project.
Technologies
Detected package dependencies: framer-motion.
Send a notification — the bell swings and the badge springs in with a rolling count
Installation
Usage
import { NotificationBell } from "@/components/spectrumui/notification-bell"<NotificationBell count={3} onClick={() => console.log("open inbox")} />API Reference
NotificationBell
Renders a single button element whose aria-label reflects the unread count. The bell swings automatically whenever count increases, and unread changes are announced through a polite live region.
| Prop | Type | Default | Description |
|---|---|---|---|
count | number | 0 | Number of unread notifications. Increases trigger the ring swing and badge animations |
max | number | 99 | Counts above this render as "max+" (99+ by default) |
dot | boolean | false | Show a small pinging dot instead of the numeric badge |
ringOnMount | boolean | false | Play the ring swing once when the component mounts |
onClick | React.MouseEventHandler<HTMLButtonElement> | - | Click handler for the bell button |
size | "sm" | "md" | "lg" | "md" | Visual size of the button |
className | string | - | Additional classes merged with the default button styles |
Examples
Dot mode and sizes
Use cases
- interfaces that need a bell button that swings on new notifications with a rolling unread badge
- form workflows
- support tools
Features
- Copy-paste source that remains in your repository
- TypeScript source included with the component
- Tailwind CSS classes editable in the component source
- Animation implemented with Motion
- Responsive Tailwind variants present in the source
- Reduced-motion handling present in the source
Accessibility
- The source includes ARIA attributes or roles; preserve them when customizing the component.
- The source checks reduced-motion preferences or includes motion-reduce styles.
- Test focus order, keyboard operation, labels, contrast, and screen-reader output in the final application context.
Customization
- Edit the Tailwind utility classes in the copied source to match your spacing, color, and typography tokens.
- Use the documented className surface for local layout adjustments, then edit the source for structural changes.
- Adjust Motion transitions in the source and keep the reduced-motion behavior aligned with the final interaction.
Related components
Topic guides
See how this component fits into broader interface patterns, implementation decisions, and working examples.
Notification Bell FAQ
Is Notification Bell free to use in commercial projects?
Yes. The public Notification Bell source is available under the Apache License 2.0, including for commercial use, subject to the LICENSE terms.
How do I install Notification Bell?
Run npx shadcn@latest add @spectrumui/notification-bell. The page also exposes the source for manual installation.
Does Notification Bell require Motion?
Yes. Motion usage was detected in the documented source or registry dependencies for Notification Bell.
Does Notification Bell use shadcn/ui or Radix UI?
No shadcn/ui or Radix UI dependency was detected in the documented Notification Bell source.
Can I use Notification Bell in Next.js?
The documented React source is used in this Next.js application. Keep its use client directive when copying it into the App Router. Install the detected dependencies and verify any application-specific data or image configuration.
What accessibility checks should I run for Notification Bell?
The source includes ARIA markup, reduced-motion handling. Test the finished interface with keyboard and screen-reader workflows.