# Ringing Bell

> A notification bell that swings now and then to draw the eye, with an unread count badge.

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

## HTML

```html
<button class="ringing-bell" aria-label="Notifications, 3 unread">
  <svg viewBox="0 0 24 24" aria-hidden="true">
    <path d="M12 3a6 6 0 0 0-6 6v4l-2 3h16l-2-3V9a6 6 0 0 0-6-6Z"/>
    <path d="M10 19a2 2 0 0 0 4 0"/>
  </svg>
  <span>3</span>
</button>
```

## CSS

```css
.ringing-bell {
  position: relative;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 6px 16px -8px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}

.ringing-bell svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: #0f172a;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform-origin: 50% 10%;
  animation: ringing-bell-swing 2.4s ease-in-out infinite;
}

.ringing-bell span {
  position: absolute;
  top: 6px;
  right: 6px;
  box-sizing: border-box;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  box-shadow: 0 0 0 2px #fff;
  color: #fff;
  font: 700 11px/18px system-ui, sans-serif;
}

.ringing-bell:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}

@keyframes ringing-bell-swing {
  0%, 35%, 100% { transform: rotate(0); }
  5% { transform: rotate(18deg); }
  10% { transform: rotate(-16deg); }
  15% { transform: rotate(12deg); }
  20% { transform: rotate(-8deg); }
  25% { transform: rotate(4deg); }
}

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

## Notes

- This CSS Ringing Bell is 57 lines of pure CSS (1.2 KB) with no JavaScript and no dependencies. It uses keyframe animations, transforms, box shadows and CSS Grid.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
