Link Search Menu Expand Document

Alerts

Provide contextual feedback messages for typical user actions with the handful of available and flexible alert messages.

Table of contents

  1. Alerts
    1. Examples
    2. Link Color
    3. Additional content

Examples

Alerts are available for any length of text. For proper styling, use one of the eight required contextual classes (e.g., .alert-success)

This is a primary alert
This is a secondary alert
This is a success alert
This is a danger alert
This is a warning alert
This is a info alert
This is a light alert
This is a dark alert
<div class="alert alert-primary">This is a primary alert</div>
<div class="alert alert-secondary">This is a secondary alert</div>
<div class="alert alert-success">This is a success alert</div>
<div class="alert alert-danger">This is a danger alert</div>
<div class="alert alert-warning">This is a warning alert</div>
<div class="alert alert-info">This is a info alert</div>
<div class="alert alert-light">This is a light alert</div>
<div class="alert alert-dark">This is a dark alert</div>

Use the .alert-link utility class to quickly provide matching colored links within any alert.

This is a primary alert with an example link.
This is a primary alert with an example link.
This is a primary alert with an example link.
This is a primary alert with an example link.
This is a primary alert with an example link.
This is a primary alert with an example link.
This is a primary alert with an example link.
This is a primary alert with an example link.
<div class="alert alert-primary">
    This is a primary alert with <a class="alert-link">an example link</a>.
</div>
<div class="alert alert-secondary">
    This is a primary alert with <a class="alert-link">an example link</a>.
</div>
<div class="alert alert-success">
    This is a primary alert with <a class="alert-link">an example link</a>.
</div>
<div class="alert alert-danger">
    This is a primary alert with <a class="alert-link">an example link</a>.
</div>
<div class="alert alert-warning">
    This is a primary alert with <a class="alert-link">an example link</a>.
</div>
<div class="alert alert-info">
    This is a primary alert with <a class="alert-link">an example link</a>.
</div>
<div class="alert alert-light">
    This is a primary alert with <a class="alert-link">an example link</a>.
</div>
<div class="alert alert-dark">
    This is a primary alert with <a class="alert-link">an example link</a>.
</div>

Additional content

Alerts can also contain additional HTML elements like headings, paragraphs and dividers.

Well done!

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.


Whenever you need to, be sure to use margin utilities to keep things nice and tidy.

<div class="alert alert-success">
  <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>