Notification Bell Dropdown
A bell with a badge and a dropdown that clears the count.
Requires Bootstrap 5. Add the CDN tags below to your page (styles in
<head>, scripts before </body>). The downloaded file already includes them.<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css"><script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script><div class="dropdown">
<button class="btn btn-light position-relative" data-bs-toggle="dropdown">🔔<span class="position-absolute top-0 start-100 translate-middle badge rounded-pill text-bg-danger" id="nbDot">2</span></button>
<div class="dropdown-menu dropdown-menu-end shadow" style="width:260px">
<h6 class="dropdown-header">Notifications</h6>
<a class="dropdown-item small" href="#">✉️ New message from Ava</a>
<a class="dropdown-item small" href="#">💰 Payment received</a>
<div class="dropdown-divider"></div>
<button class="dropdown-item small text-center text-primary" id="nbClear">Mark all read</button>
</div>
</div>document.getElementById('nbClear').onclick=function(){var d=document.getElementById('nbDot');d.style.display='none'};Free to use.This component uses Bootstrap 5 (linked above). Copy any file, or download a ready-to-open .html page with the CDN links already included.