Toasts

Push notifications to your visitors with a toast, a lightweight and easily customizable alert message.

Toasts on Bootstrap
Basic Example
<div class="toast show" role="alert" aria-live="assertive" aria-atomic="true">
  <div class="toast-header">
    <strong class="mr-auto">Bootstrap</strong>
    <small>11 mins ago</small>
    <button class="ml-2 mb-1 close" type="button" data-dismiss="toast" aria-label="Close">
      <span aria-hidden="true">×</span>
    </button></div>
  <div class="toast-body">Hello, world! This is a toast message.</div>
</div>
Stacking

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

<div class="toast show" role="alert" aria-live="assertive" aria-atomic="true">
  <div class="toast-header">
    <strong class="mr-auto">Bootstrap</strong>
    <small class="text-muted">just now
    </small><button class="ml-2 mb-1 close" type="button" data-dismiss="toast" aria-label="Close">
      <span aria-hidden="true">×</span></button>
  </div>
  <div class="toast-body">See? Just like this.</div>
</div>
<div class="toast show" role="alert" aria-live="assertive" aria-atomic="true">
  <div class="toast-header"><strong class="mr-auto">Bootstrap</strong><small class="text-muted">2 seconds ago</small><button class="ml-2 mb-1 close" type="button" data-dismiss="toast" aria-label="Close"><span aria-hidden="true">×</span></button></div>
  <div class="toast-body">Heads up, toasts will stack automatically</div>
</div>
Placement

Place toasts with the helper classes 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.

Bootstrap11 mins ago
Hello, world! This is a toast message.
<div class="position-relative" aria-live="polite" aria-atomic="true" style="min-height: 90px;">
  <div class="toast show position-absolute t-0 r-0">
    <div class="toast-header"><strong class="mr-auto">Bootstrap</strong><small>11 mins ago</small><button class="ml-2 mb-1 close" type="button" data-dismiss="toast" aria-label="Close"><span aria-hidden="true">×</span></button></div>
    <div class="toast-body">Hello, world! This is a toast message.</div>
  </div>
</div>

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

<div class="d-flex justify-content-center align-items-center" aria-live="polite" aria-atomic="true" style="min-height: 300px;">
  <div class="toast show" role="alert" aria-live="assertive" aria-atomic="true">
    <div class="toast-header"><strong class="mr-auto">Bootstrap</strong><small>11 mins ago</small><button class="ml-2 mb-1 close" type="button" data-dismiss="toast" aria-label="Close"><span aria-hidden="true">×</span></button></div>
    <div class="toast-body">Hello, world! This is a toast message.</div>
  </div>
</div>

Start building beautiful apps

Contact

369 ape view Avenue

Brooklyn, NY

369 ape view Avenue

Mon - Fri 9am - 5pm

+91 3929 3355

Brooklyn, NY

Subscribe

Latest Shape news, articles, and resources sent straight to your inbox every month.

We’ll never share your details. See our Privacy Policy

Made With by ThemeWagon