</> ConvertAtlas Developer Tools
Bootstrap 5 · Beginner

Dismissible Alerts

Stacked alerts that fade out and remove when dismissed.

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 style="max-width:360px" id="daWrap">
  <div class="alert alert-info d-flex justify-content-between align-items-center"><span class="small">Welcome! Complete your profile.</span><button class="btn-close" data-da></button></div>
  <div class="alert alert-success d-flex justify-content-between align-items-center"><span class="small">Your order shipped.</span><button class="btn-close" data-da></button></div>
  <div class="alert alert-warning d-flex justify-content-between align-items-center mb-0"><span class="small">Storage almost full.</span><button class="btn-close" data-da></button></div>
</div>
document.querySelectorAll('#daWrap [data-da]').forEach(function(b){b.onclick=function(){var a=b.closest('.alert');a.style.transition='opacity .3s';a.style.opacity='0';setTimeout(function(){a.remove()},300)}});
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.