Alerts

Provide contextual feedback messages for typical user actions.

Bootstrap docs

Basic example

<!-- Primary alert -->
<div class="alert alert-primary" role="alert">
  A simple primary alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.
</div>

<!-- Secondary alert -->
<div class="alert alert-secondary" role="alert">
  A simple secondary alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.
</div>

<!-- Success alert -->
<div class="alert alert-success" role="alert">
  A simple success alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.
</div>

<!-- Danger alert -->
<div class="alert alert-danger" role="alert">
  A simple danger alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.
</div>

<!-- Warning alert -->
<div class="alert alert-warning" role="alert">
  A simple warning alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.
</div>

<!-- Info alert -->
<div class="alert alert-info" role="alert">
  A simple info alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.
</div>

<!-- Light alert -->
<div class="alert alert-light" role="alert">
  A simple light alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.
</div>

<!-- Dark alert -->
<div class="alert alert-dark" role="alert">
  A simple dark alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.
</div>

Alert with icon

<!-- Primary alert -->
<div class="alert alert-primary" role="alert">
  <div class="media align-items-center">
    <i class="cxi-bell lead mr-3"></i>
    <div class="media-body">
      A simple primary alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.
    </div>
  </div>
</div>

<!-- Secondary alert -->
<div class="alert alert-secondary" role="alert">
  <div class="media align-items-center">
    <i class="cxi-clock lead mr-3"></i>
    <div class="media-body">
      A simple secondary alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.
    </div>
  </div>
</div>

<!-- Success alert -->
<div class="alert alert-success" role="alert">
  <div class="media align-items-center">
    <i class="cxi-check lead mr-3"></i>
    <div class="media-body">
      A simple success alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.
    </div>
  </div>
</div>

<!-- Danger alert -->
<div class="alert alert-danger" role="alert">
  <div class="media align-items-center">
    <i class="cxi-close-round lead mr-3"></i>
    <div class="media-body">
      A simple danger alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.
    </div>
  </div>
</div>

<!-- Warning alert -->
<div class="alert alert-warning" role="alert">
  <div class="media align-items-center">
    <i class="cxi-alert lead mr-3"></i>
    <div class="media-body">
      A simple warning alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.
    </div>
  </div>
</div>

<!-- Info alert -->
<div class="alert alert-info" role="alert">
  <div class="media align-items-center">
    <i class="cxi-alert-octagon lead mr-3"></i>
    <div class="media-body">
      A simple info alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.
    </div>
  </div>
</div>

<!-- Light alert -->
<div class="alert alert-light" role="alert">
  <div class="media align-items-center">
    <i class="cxi-unlock lead mr-3"></i>
    <div class="media-body">
      A simple light alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.
    </div>
  </div>
</div>

<!-- Dark alert -->
<div class="alert alert-dark" role="alert">
  <div class="media align-items-center">
    <i class="cxi-map-pin-outline lead mr-3"></i>
    <div class="media-body">
      A simple dark alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.
    </div>
  </div>
</div>

Dismissible alerts

<!-- Primary alert -->
<div class="alert alert-primary alert-dismissible fade show" role="alert">
  <span class="font-weight-medium">Primary alert:</span> Dismiss me by clicking the close button on the right.
  <button type="button" class="close" data-dismiss="alert" aria-label="Close">
    <span aria-hidden="true">&times;</span>
  </button>
</div>

<!-- Secondary alert -->
<div class="alert alert-secondary alert-dismissible fade show" role="alert">
  <span class="font-weight-medium">Secondary alert:</span> Dismiss me by clicking the close button on the right.
  <button type="button" class="close" data-dismiss="alert" aria-label="Close">
    <span aria-hidden="true">&times;</span>
  </button>
</div>

<!-- Success alert -->
<div class="alert alert-success alert-dismissible fade show" role="alert">
  <span class="font-weight-medium">Success alert:</span> Dismiss me by clicking the close button on the right.
  <button type="button" class="close" data-dismiss="alert" aria-label="Close">
    <span aria-hidden="true">&times;</span>
  </button>
</div>

<!-- Danger alert -->
<div class="alert alert-danger alert-dismissible fade show" role="alert">
  <span class="font-weight-medium">Danger alert:</span> Dismiss me by clicking the close button on the right.
  <button type="button" class="close" data-dismiss="alert" aria-label="Close">
    <span aria-hidden="true">&times;</span>
  </button>
</div>

<!-- Warning alert -->
<div class="alert alert-warning alert-dismissible fade show" role="alert">
  <span class="font-weight-medium">Warning alert:</span> Dismiss me by clicking the close button on the right.
  <button type="button" class="close" data-dismiss="alert" aria-label="Close">
    <span aria-hidden="true">&times;</span>
  </button>
</div>

<!-- Info alert -->
<div class="alert alert-info alert-dismissible fade show" role="alert">
  <span class="font-weight-medium">Info alert:</span> Dismiss me by clicking the close button on the right.
  <button type="button" class="close" data-dismiss="alert" aria-label="Close">
    <span aria-hidden="true">&times;</span>
  </button>
</div>

<!-- Light alert -->
<div class="alert alert-light alert-dismissible fade show" role="alert">
  <span class="font-weight-medium">Light alert:</span> Dismiss me by clicking the close button on the right.
  <button type="button" class="close" data-dismiss="alert" aria-label="Close">
    <span aria-hidden="true">&times;</span>
  </button>
</div>

<!-- Dark alert -->
<div class="alert alert-dark alert-dismissible fade show" role="alert">
  <span class="font-weight-medium">Dark alert:</span> Dismiss me by clicking the close button on the right.
  <button type="button" class="close" data-dismiss="alert" aria-label="Close">
    <span aria-hidden="true">&times;</span>
  </button>
</div>

Additional content

<!-- Primary alert -->
<div class="alert alert-primary" role="alert">
  <h4 class="pt-2 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="pt-3 mb-2">Whenever you need to, be sure to use margin utilities to keep things nice and tidy.</p>
</div>
Top