Skip to main content
Figuration v3 Preview Available!
Components

Reusable components built to provide alerts, button groups, cards, input groups, media objects, navigation, and much more.

Alerts

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

Contents

Examples

Alerts are available for any length of text, as well as an optional dismiss button. For proper styling, use of the contextual classes (e.g., .alert-success) is required. For inline dismissal, use the Alert jQuery widget.

<div class="alert alert-primary" role="alert">
  <strong>Primary!</strong> You read this important alert message.
</div>
<div class="alert alert-secondary" role="alert">
  <strong>Secondary!</strong> You read this important alert message.
</div>
<div class="alert alert-success" role="alert">
  <strong>Success!</strong> You successfully read this alert message.
</div>
<div class="alert alert-info" role="alert">
  <strong>Infomation!</strong> Something needs your attention, but it is not urgent.
</div>
<div class="alert alert-warning" role="alert">
  <strong>Warning!</strong> Something seems to have gone wrong with this item.
</div>
<div class="alert alert-danger" role="alert">
  <strong>Danger!</strong> There is definitaly some error now.
</div>

Conveying Meaning to Assistive Technologies

Using color to add meaning only provides a visual indication, which will not be conveyed to users of assistive technologies—such as screen readers. Ensure that information denoted by the color is either obvious from the content itself (e.g. the visible text), or is included through alternative means, such as additional text hidden with the .sr-only class.

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

<div class="alert alert-primary" role="alert">
  <strong>Primary!</strong> You read <a href="#" class="alert-link">this important alert message</a>.
</div>
<div class="alert alert-secondary" role="alert">
  <strong>Secondary!</strong> You read <a href="#" class="alert-link">this important alert message</a>.
</div>
<div class="alert alert-success" role="alert">
  <strong>Success!</strong> You successfully read <a href="#" class="alert-link">this alert message</a>.
</div>
<div class="alert alert-info" role="alert">
  <strong>Information!</strong> Something <a href="#" class="alert-link">needs your attention</a>, but it is not urgent.
</div>
<div class="alert alert-warning" role="alert">
  <strong>Warning!</strong> Something seems to have gone <a href="#" class="alert-link">wrong with this item</a>.
</div>
<div class="alert alert-danger" role="alert">
  <strong>Danger!</strong> There is definitaly <a href="#" class="alert-link">some error</a> now.
</div>

Additional Content

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

<div class="alert alert-success" role="alert">
  <h4 class="alert-heading">Well done!</h4>
  <p>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>
  <p class="mb-0">Whenever you need to, be sure to use margin utilities to keep things nice and tidy.</p>
</div>