Bootstrap Toasts

Default Toast

Use toast class to set a default toast.

Translucent

Toasts are slightly translucent, too, so they blend over whatever they might appear over.

Stacking

When you have multiple toasts, we default to vertically stacking them in a readable manner.

Placement

Place toasts with custom CSS as you need them. The top right is often used for notifications, as is the top middle. If you're only ever going to show one toast at a time, put the positioning styles right on the .toast.

You can also get fancy with flexbox utilities to align toasts horizontally and/or vertically.

<!-- Default Toast --> 
<div class="toast fade show" role="alert" aria-live="assertive"
    data-bs-autohide="false" aria-atomic="true">
    <div class="toast-header">
        <img src="assets/images/logo-sm.png" class="rounded me-2"
            alt="..." height="20">
        <span class="fw-semibold me-auto">BitReport</span>
        <small>06 mins ago</small>
        <button type="button" class="btn-close"
            data-bs-dismiss="toast" aria-label="Close"></button>
    </div>
    <div class="toast-body">
        Hello, world! This is a toast message.
    </div>
</div>

<!-- Translucent Toast --> 
<div class="p-3 bg-light">
    <div class="toast fade show" role="alert" aria-live="assertive"
        data-bs-autohide="false" aria-atomic="true">
        <div class="toast-header">
            <img src="assets/images/logo-sm.png" class="rounded me-2"
                alt="..." height="20">
            <span class="fw-semibold me-auto">BitReport</span>
            <small>11 mins ago</small>
            <button type="button" class="btn-close"
                data-bs-dismiss="toast" aria-label="Close"></button>
        </div>
        <div class="toast-body">
            Hello, world! This is a toast message.
        </div>
    </div>
</div>

<!-- Stacking Toast --> 
<div class="toast fade show" role="alert" aria-live="assertive"
    data-bs-autohide="false" aria-atomic="true">
    <div class="toast-header">
        <img src="assets/images/logo-sm.png" class="rounded me-2"
            alt="..." height="20">
        <span class="fw-semibold me-auto">BitReport</span>
        <small>Just now</small>
        <button type="button" class="btn-close"
            data-bs-dismiss="toast" aria-label="Close"></button>
    </div>
    <div class="toast-body">
        See? Just like this.
    </div>
</div>

<!-- Placement Toast --> 
<div class="bg-light" aria-live="polite" aria-atomic="true"
    style="position: relative; min-height: 200px;">
    <div class="toast fade show" role="alert" aria-live="assertive"
        aria-atomic="true" data-bs-toggle="toast"
        style="position: absolute; top: 16px; right: 16px;">
        <div class="toast-header">
            <img src="assets/images/logo-sm.png"
                class="rounded me-2" alt="..." height="20">
            <span class="fw-semibold me-auto">BitReport</span>
            <small>06 mins ago</small>
            <button type="button" class="btn-close"
                data-bs-dismiss="toast" aria-label="Close"></button>
        </div>
        <div class="toast-body">
            Hello, world! This is a toast message.
        </div>
    </div>
</div>

 <!-- Flexbox container for aligning the toasts -->
<div aria-live="polite" aria-atomic="true"
    class="bg-light d-flex justify-content-center align-items-center"
    style="height: 200px;">
    <div class="toast fade show" role="alert" aria-live="assertive"
        data-bs-autohide="false" aria-atomic="true">
        <div class="toast-header">
            <img src="assets/images/logo-sm.png"
                class="rounded me-2" alt="..." height="20">
            <span class="fw-semibold me-auto">BitReport</span>
            <small>11 mins ago</small>
            <button type="button" class="btn-close"
                data-bs-dismiss="toast" aria-label="Close"></button>
        </div>
        <div class="toast-body">
            Hello, world! This is a toast message.
        </div>
    </div>
</div>