# Pendulum bell

A notification bell that swings and rings when something lands.

Also called: notification bell, bell animation, bell icon animation.

> chatcn Pro: needs a Pro license (https://chatcn.dev/pro). Install from the `@chatcn-pro` registry with your license token; setup at https://chatcn.dev/docs/chatcn-pro.

Example: A bell that swings when something lands. Each new notification swings the bell; the clapper lags and knocks, a ring flashes, and the badge counts up, then folds away when read. Preview: https://chatcn.dev/preview/pendulum-bell-demo

The shell hangs from a pivot as a pendulum, and the clapper is a second, lazier pendulum on the same pivot that lags behind and knocks against the inner wall; a knock hard enough draws two short ring strokes. A new notification swings it, a click nudges it the other way, and the badge springs in and counts, then shrinks to a dot and drops away when it reaches zero. For when an agent finishes or needs you.

## Installation

```bash
npx shadcn@latest add @chatcn-pro/pendulum-bell
```

## Usage

```tsx
import { PendulumBell } from "@/components/ui/chatcn/pro/pendulum-bell"

<PendulumBell count={unread} open={open} onClick={() => setOpen((o) => !o)} />
```

## Props

| Prop | Type | Notes |
| --- | --- | --- |
| `count` | `number` | Each rise swings the bell |
| `open` | `boolean` | Sets `aria-expanded` and the pressed look |
| `label` | `string` | Default Notifications |

## Accessibility

- A button named with the unread count, with `aria-expanded` for its panel.

## Motion

- Two coupled pendulums in 4 sub steps a frame; the ring fades in about 200 ms. Reduced motion: the bell holds still and the badge just counts.

Source: https://chatcn.dev/docs/components/pendulum-bell