Bootstrap 5 toasts are lightweight notifications that appear temporarily in a corner of the screen. This page covers 4 toast patterns ā basic, colored, progress bar and stacked ā each with working copy-paste code.
Quick Setup
Toasts require Bootstrap 5 JS bundle:
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
Key Classes Reference
| Class | What It Does |
|---|---|
.toast | Required toast wrapper |
.toast-header | Header with title and close button |
.toast-body | Main message content |
.show | Makes toast visible (for static display) |
.position-fixed | Fixed position wrapper |
.top-0.end-0 | Top-right corner position |
.bottom-0.end-0 | Bottom-right corner position |
data-bs-dismiss="toast" | Close button attribute |
delay | Auto-dismiss delay in ms (default 5000) |
autohide: false | Disables auto-dismiss |
1. Basic Bootstrap 5 Toast
A standard Bootstrap 5 toast with header, body and auto-dismiss. Click the button to show it.
2. Bootstrap 5 Colored Toasts
Toasts with success, warning, danger and info colors using Bootstrap background utilities.
3. Bootstrap 5 Toast with Progress Bar
Toast with an animated progress bar that counts down to auto-dismiss.
4. Bootstrap 5 Toast Stack
Multiple toasts stacked vertically in the corner. Each can be dismissed independently.
Frequently Asked Questions
Need a Full Bootstrap 5 Admin Dashboard?
Get a complete Angular 21 + Bootstrap 5 dashboard with 50+ components ā built by the same team behind BootstrapPlanet.
Browse Templates āUse code FIRST30 for 30% off your first purchase.