# Notification Badge

> A bell icon button with an unread-count badge that rings on hover.

- Category: [CSS Effects](https://copy-css.com/category/effects)
- Tags: badge, bell, notification, count, icon
- Live preview: https://copy-css.com/snippets/notification-badge
- License: Free for personal and commercial use. No signup, no attribution required.

## HTML

```html
<button class="notify-bell" aria-label="3 notifications">
  <svg viewBox="0 0 24 24"><path d="M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9"/><path d="M10.3 21a1.94 1.94 0 0 0 3.4 0"/></svg>
  <span class="notify-bell-count">3</span>
</button>
```

## CSS

```css
.notify-bell {
  position: relative;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
}

.notify-bell svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: #111;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform-origin: top center;
}

.notify-bell:hover svg {
  animation: notify-bell-ring 0.6s ease;
}

.notify-bell-count {
  position: absolute;
  top: -6px;
  right: -6px;
  box-sizing: border-box;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font: 700 11px/16px system-ui, sans-serif;
  text-align: center;
}

@keyframes notify-bell-ring {
  20% { transform: rotate(14deg); }
  40% { transform: rotate(-12deg); }
  60% { transform: rotate(8deg); }
  80% { transform: rotate(-4deg); }
}

@media (prefers-reduced-motion: reduce) {
  .notify-bell:hover svg {
    animation: none;
  }
}
```

## Notes

- This CSS Notification Badge is 55 lines of pure CSS (1.0 KB) with no JavaScript and no dependencies. It uses keyframe animations, transforms, CSS Grid and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
