Alerts

Use alerts to provide contextual feedback to your users based on their input and behaviour

Alerts

Alerts can be used to show your users error, success, informational or warning messages. Use the color variables such as alert-primary or alert-secondary to add your preferred colors:

<div class="alert alert-primary" role="alert">
  A simple primary alert—check it out!
</div>
<div class="alert alert-secondary" role="alert">
  A simple secondary alert—check it out!
</div>
<div class="alert alert-success" role="alert">
  A simple success alert—check it out!
</div>
<div class="alert alert-danger" role="alert">
  A simple danger alert—check it out!
</div>
<div class="alert alert-warning" role="alert">
  A simple warning alert—check it out!
</div>
<div class="alert alert-info" role="alert">
  A simple info alert—check it out!
</div>
<div class="alert alert-light" role="alert">
  A simple light alert—check it out!
</div>
<div class="alert alert-dark" role="alert">
  A simple dark alert—check it out!
</div>

Dismissable alerts with icons Pro

The following alerts are coupled with descriptive icons:

<div class="alert alert-primary alert-dismissible fade show" role="alert">
  <span class="fas fa-bullhorn me-1"></span>
  <strong>Holy guacamole!</strong> You should check in on some of those fields below.
  <button type="button" class="btn-close btn-sm" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
<div class="alert alert-secondary alert-dismissible fade show" role="alert">
  <span class="fas fa-bullhorn me-1"></span>
  <strong>Holy guacamole!</strong> You should check in on some of those fields below.
  <button type="button" class="btn-close btn-sm" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
<div class="alert alert-tertiary alert-dismissible fade show" role="alert">
  <span class="fas fa-bullhorn me-1"></span>
  <strong>Holy guacamole!</strong> You should check in on some of those fields below.
  <button type="button" class="btn-close btn-sm" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
<div class="alert alert-danger alert-dismissible fade show" role="alert">
  <span class="fas fa-bullhorn me-1"></span>
  <strong>Holy guacamole!</strong> You should check in on some of those fields below.
  <button type="button" class="btn-close btn-sm" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
<div class="alert alert-warning alert-dismissible fade show" role="alert">
  <span class="fas fa-bullhorn me-1"></span>
  <strong>Holy guacamole!</strong> You should check in on some of those fields below.
  <button type="button" class="btn-close btn-sm" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
<div class="alert alert-info alert-dismissible fade show" role="alert">
  <span class="fas fa-bullhorn me-1"></span>
  <strong>Holy guacamole!</strong> You should check in on some of those fields below.
  <button type="button" class="btn-close btn-sm" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
<div class="alert alert-light alert-dismissible fade show" role="alert">
  <span class="fas fa-bullhorn me-1"></span>
  <strong>Holy guacamole!</strong> You should check in on some of those fields below.
  <button type="button" class="btn-close btn-sm" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
<div class="alert alert-dark alert-dismissible fade show" role="alert">
  <span class="fas fa-bullhorn me-1"></span>
  <strong>Holy guacamole!</strong> You should check in on some of those fields below.
  <button type="button" class="btn-close btn-sm" data-bs-dismiss="alert" aria-label="Close"></button>
</div>

Alerts with extra content Pro

The following alerts are useful when you want to give more information and context to your users:

<div class="alert alert-success" role="alert">
    <div class="alert-icon">
        <span class="fas fa-bell"></span>
    </div>
    <h4 class="alert-heading">Well done!</h4>
    <p>Aww yeah, you successfully read this important alert message. This example text is going to run a bit longer so that you can see how spacing within an alert works with this kind of content.</p>
    <hr>
    <p class="mb-0">Whenever you need to, be sure to use margin utilities to keep things nice and tidy.</p>
</div>
<div class="alert alert-info" role="alert">
    <div class="alert-icon">
        <span class="fas fa-bell"></span>
    </div>
    <h4 class="alert-heading">Heads up!</h4>
    <p>Aww yeah, you successfully read this important alert message. This example text is going to run a bit longer so that you can see how spacing within an alert works with this kind of content.</p>
    <hr>
    <p class="mb-0">Whenever you need to, be sure to use margin utilities to keep things nice and tidy.</p>
</div>
<div class="alert alert-warning" role="alert">
    <div class="alert-icon">
        <span class="fas fa-bell"></span>
    </div>
    <h4 class="alert-heading">Warning!</h4>
    <p>Aww yeah, you successfully read this important alert message. This example text is going to run a bit longer so that you can see how spacing within an alert works with this kind of content.</p>
    <hr>
    <p class="mb-0">Whenever you need to, be sure to use margin utilities to keep things nice and tidy.</p>
</div>
<div class="alert alert-danger" role="alert">
    <div class="alert-icon">
        <span class="fas fa-bell"></span>
    </div>
    <h4 class="alert-heading">Danger!</h4>
    <p>Aww yeah, you successfully read this important alert message. This example text is going to run a bit longer so that you can see how spacing within an alert works with this kind of content.</p>
    <hr>
    <p class="mb-0">Whenever you need to, be sure to use margin utilities to keep things nice and tidy.</p>
</div>
<div class="alert alert-light" role="alert">
    <div class="alert-icon">
        <span class="fas fa-bell"></span>
    </div>
    <h4 class="alert-heading">Light!</h4>
    <p>Aww yeah, you successfully read this important alert message. This example text is going to run a bit longer so that you can see how spacing within an alert works with this kind of content.</p>
    <hr>
    <p class="mb-0">Whenever you need to, be sure to use margin utilities to keep things nice and tidy.</p>
</div>