widgets
beginner
notification
badge
animation
alert
ui
Category · Widgets Difficulty Level · Beginner Published on · August 22, 2025

Animated Notification Badge

Modern notification badge with smooth animations, customizable styles, and interactive features, perfect for user notifications and alerts.

#notification #badge #animation #alert #ui

Responsive Design

Yes

Dark Mode Support

No

lines

473

Browser Compatibility

Chrome · Firefox · Safari · Edge

Live Preview

Interact with the component without leaving the page.

200px

Overview

Modern notification badge with smooth animations, customizable styles, and interactive features, perfect for user notifications and alerts.

How to use

  1. Copy the HTML markup into your page.
  2. Paste the CSS into your stylesheet and ensure the selectors match your markup.
  3. Paste the JavaScript and load it after the markup.
  4. Adjust spacing, colors, and text to match your design system.

Customization tips

  • Rename class names to avoid collisions with your existing CSS.
  • Replace hard-coded colors with CSS variables for theming.
  • Verify the layout at 320px, 768px, and 1024px widths.

HTML

47

lines

CSS

291

lines

JavaScript

135

lines


                <div class="notification-badge-container">
  <div class="notification-badge-demo">
    <div class="demo-header">
      <h2>Notification Badges</h2>
      <p>Interactive badges with animations</p>
    </div>
    
    <div class="badges-wrapper">
      <div class="badge-item">
        <div class="icon-wrapper">
          <span class="icon">🔔</span>
          <span class="notification-badge" id="notificationBadge1">3</span>
        </div>
        <div class="badge-label">Messages</div>
      </div>
      
      <div class="badge-item">
        <div class="icon-wrapper">
          <span class="icon">📧</span>
          <span class="notification-badge success" id="notificationBadge2">5</span>
        </div>
        <div class="badge-label">Emails</div>
      </div>
      
      <div class="badge-item">
        <div class="icon-wrapper">
          <span class="icon">🛒</span>
          <span class="notification-badge warning" id="notificationBadge3">12</span>
        </div>
        <div class="badge-label">Cart</div>
      </div>
      
      <div class="badge-item">
        <div class="icon-wrapper">
          <span class="icon">❤️</span>
          <span class="notification-badge error" id="notificationBadge4">7</span>
        </div>
        <div class="badge-label">Likes</div>
      </div>
    </div>
    
    <div class="controls-wrapper">
      <button class="btn btn-primary" id="addNotificationBtn">Add Notification</button>
      <button class="btn btn-secondary" id="clearNotificationsBtn">Clear All</button>
    </div>
  </div>
</div>

              
47lines
1560characters
HTMLLanguage

Browser Compatibility

Chrome

>= 50

Firefox

>= 45

Safari

>= 10

Edge

>= 15

Related Code Snippets

Explore template packs

Need larger building blocks? Browse responsive landing pages and component bundles.

Open HTML Template Library ->