Skip to content
caliper ui docs

Pro

Notification bell

The bell that opens notifications: the unread count sits on it and rolls to its new value, the bell swings once when the count rises, and its name always says how many are unread.

Pro
pnpm dlx shadcn@latest add @caliper/notification-bell
HaldenFinance workspace · 7 members
Open invoices€48,210Unmatched payments7
Installs components/ui/notification-bell.tsxDepends on lucide-reactMotion none in component source

When to use

Use it for

  • The notifications entry in an app header.
  • Anywhere a count of unread items opens a list.

Skip it when

  • Counts that change every second; show a live indicator instead.

Decisions

Why it is built this way, so you know what to keep when you change your copy.

Behaviour

Swing once when the count rises, never when it falls
A new arrival is worth a glance; reading notifications is not. One swing, then stillness, so the header never keeps moving.
The name carries the count
The visible badge is hidden from assistive technology and the button is named “Notifications, 3 unread”, so the number is never read twice or missed.

Styling

Ink badge, not red
Unread is not an error. The badge uses the text colour with a ring of page colour so it reads on any header.

Usage

Use it as the trigger
It takes a ref and spreads props, so it can be the child of a popover or menu trigger directly.

Installation

terminal
pnpm dlx shadcn@latest add @caliper/notification-bell

Adds its 2 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.

Usage

Import it from your copy of the source. The example behind the preview comes with the source.

example.tsx
import { NotificationBell } from "@/components/ui/notification-bell"

The worked example comes with Pro

The 60-line example behind the preview opens here, ready to copy.

  • 626 Pro parts, blocks and page templates, all with source
  • $149 once, with lifetime updates. No renewal
  • A full refund within 14 days if it is not for you
Checking your licence…

API reference

NotificationBell

component

Also accepts the native props of its root element and a ref.

PropTypeDefaultDescription
count *number—Unread notifications.
maxnumber9Above this the badge reads "max+".
mutedbooleanfalseNotifications are paused: the bell is crossed out and the badge hidden.
labelstring"Notifications"

Accessibility

It is built on native elements and keeps aria-label and aria-hidden in step with state.

No custom key handling; Tab and the native activation keys do the work.

Motion

It declares no animation in its component source. Any transition comes from its stylesheet, which uses the duration tokens that collapse to instant under prefers-reduced-motion.

All Status examples