Notification Bell

A bell that swings and rings, with a badge that pops and bumps.

Preview

"use client";

import { useState } from "react";
import { NotificationBell } from "@/components/motion/notification-bell";

export function NotificationBellUsage() {
  const [count, setCount] = useState(3);
  return <NotificationBell count={count} onCountChange={setCount} />;
}

Install

Add it with the shadcn CLI, or copy the source manually.

$ bunx --bun shadcn add @beui/notification-bell

API Reference

count?
number

Unread count.

Default—
defaultCount?
number

The initial unread count when uncontrolled. Default: 0

Default0
onCountChange?
((count: number) => void)

Called with 0 when the bell is pressed, and with any count you set.

Default—
max?
number

Counts above this show as "9+".

Default9
labels?
Partial<{ notifications: string; unread: string; }>

Override any built-in string, e.g. for translation.

Default—
sound?
boolean

Play a small bell when the count goes up and a tap when it is cleared. Off by default; a `SoundProvider` can mute it app-wide.

Defaultfalse
className?
string

Classes merged onto the root element.

Default—

Updated