Toast with Header
Preview
Code
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container py-5">
<button class="btn btn-secondary" id="headerBtn">
Show Toast
</button>
<div class="toast mt-3" id="headerToast">
<div class="toast-header">
<strong class="me-auto">System</strong>
<small>Just now</small>
<button class="btn-close ms-2" data-bs-dismiss="toast"></button>
</div>
<div class="toast-body">
Your changes were saved successfully.
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<script>
var toast=new bootstrap.Toast(document.getElementById("headerToast"))
document.getElementById("headerBtn").onclick=function(){toast.show()}
</script>
</body>
</html>