Alerts

Provide contextual feedback messages for typical user actions.

Bootstrap docs

Basic example

<!-- Primary alert -->
<ngb-alert [dismissible]="false" type="primary">
  A simple primary alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.
</ngb-alert>

<!-- Accent alert -->
<ngb-alert [dismissible]="false" type="accent">
  A simple accent alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.
</ngb-alert>

<!-- Secondary alert -->
<ngb-alert [dismissible]="false" type="secondary">
  A simple secondary alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.
</ngb-alert>

<!-- Success alert -->
<ngb-alert [dismissible]="false" type="success">
  A simple success alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.
</ngb-alert>

<!-- Danger alert -->
<ngb-alert [dismissible]="false" type="danger">
  A simple danger alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.
</ngb-alert>

<!-- Warning alert -->
<ngb-alert [dismissible]="false" type="warning">
  A simple warning alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.
</ngb-alert>

<!-- Info alert -->
<ngb-alert [dismissible]="false" type="info">
  A simple info alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.
</ngb-alert>

<!-- Light alert -->
<ngb-alert [dismissible]="false" type="light">
  A simple light alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.
</ngb-alert>

<!-- Dark alert -->
<ngb-alert [dismissible]="false" type="dark">
  A simple dark alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.
</ngb-alert>

Alert with icon

<!-- Primary alert -->
  <ngb-alert [dismissible]="false" type="primary" class="alert alert-primary d-flex">
  <i class="fi-bell me-2 me-sm-3 lead"></i>
  <div>A simple primary alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.</div>
</ngb-alert>

<!-- Accent alert -->
<ngb-alert [dismissible]="false" type="accent" class="alert alert-accent d-flex">
  <i class="fi-bell me-2 me-sm-3 lead"></i>
  <div>A accent primary alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.</div>
</ngb-alert>

<!-- Secondary alert -->
<ngb-alert [dismissible]="false" type="secondary" class="alert alert-secondary d-flex">
  <i class="fi-bell me-2 me-sm-3 lead"></i>
  <div>A secondary primary alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.</div>
</ngb-alert>

<!-- Success alert -->
<ngb-alert [dismissible]="false" type="success" class="alert alert-success d-flex">
  <i class="fi-bell me-2 me-sm-3 lead"></i>
  <div>A success primary alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.</div>
</ngb-alert>

<!-- Danger alert -->
<ngb-alert [dismissible]="false" type="danger" class="alert alert-danger d-flex">
  <i class="fi-bell me-2 me-sm-3 lead"></i>
  <div>A danger primary alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.</div>
</ngb-alert>

<!-- Warning alert -->
<ngb-alert [dismissible]="false" type="warning" class="alert alert-warning d-flex">
  <i class="fi-bell me-2 me-sm-3 lead"></i>
  <div>A warning primary alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.</div>
</ngb-alert>

<!-- Info alert -->
<ngb-alert [dismissible]="false" type="simple" class="alert alert-simple d-flex">
  <i class="fi-bell me-2 me-sm-3 lead"></i>
  <div>A simple primary alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.</div>
</ngb-alert>

<!-- Light alert -->
<ngb-alert [dismissible]="false" type="light" class="alert alert-light d-flex">
  <i class="fi-bell me-2 me-sm-3 lead"></i>
  <div>A light primary alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.</div>
</ngb-alert>

<!-- Dark alert -->
<ngb-alert [dismissible]="false" type="dark" class="alert alert-dark d-flex">
  <i class="fi-bell me-2 me-sm-3 lead"></i>
  <div>A dark primary alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.</div>
</ngb-alert>

Dismissible alerts

<!-- Primary alert -->
  <ngb-alert [dismissible]="false" type="primary" class="alert alert-primary alert-dismissible fade show">
  <span class="fw-bold">Primary alert:</span> Dismiss me by clicking the close button on the right.
  <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</ngb-alert>

<!-- Secondary alert -->
<ngb-alert [dismissible]="false" type="secondary" class="alert alert-secondary alert-dismissible fade show">
  <span class="fw-bold">secondary alert:</span> Dismiss me by clicking the close button on the right.
  <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</ngb-alert>

<!-- Success alert -->
<ngb-alert [dismissible]="false" type="success" class="alert alert-success alert-dismissible fade show">
  <span class="fw-bold">success alert:</span> Dismiss me by clicking the close button on the right.
  <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</ngb-alert>

<!-- Danger alert -->
<ngb-alert [dismissible]="false" type="dismissible" class="alert alert-danger alert-dismissible fade show">
  <span class="fw-bold">Danger alert:</span> Dismiss me by clicking the close button on the right.
  <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</ngb-alert>

<!-- Warning alert -->
<ngb-alert [dismissible]="false" type="warning" class="alert alert-warning alert-dismissible fade show">
  <span class="fw-bold">warning alert:</span> Dismiss me by clicking the close button on the right.
  <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</ngb-alert>

<!-- Info alert -->
<ngb-alert [dismissible]="false" type="dismissible" class="alert alert-dismissible alert-dismissible fade show">
  <span class="fw-bold">Info alert:</span> Dismiss me by clicking the close button on the right.
  <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</ngb-alert>

<!-- Light alert -->
<ngb-alert [dismissible]="false" type="light" class="alert alert-light alert-dismissible fade show">
  <span class="fw-bold">Light alert:</span> Dismiss me by clicking the close button on the right.
  <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</ngb-alert>

<!-- Dark alert -->
<ngb-alert [dismissible]="false" type="dark" class="alert alert-dark alert-dismissible fade show">
  <span class="fw-bold">dark alert:</span> Dismiss me by clicking the close button on the right.
  <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</ngb-alert>

Additional content

<!-- Accent alert -->
<div class="alert alert-accent" 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>

Background image

<!-- Alert with bakground image -->
<div class="alert alert-dismissible bg-size-cover fade show text-center py-5" style="background-image: url(path-to-image)" role="alert">
  <i class="ci-time d-block text-white my-4" style="font-size: 3rem;"></i>
  <h2 class="text-white text-shadow">Check Our Limited Offers!</h2>
  <h4 class="text-white fs-normal text-shadow mb-4 pb-2">Save up to 50%</h4>
  <a href="#" class="btn btn-primary mb-3">View offers</a>
  <button type="button" class="btn-close btn-close-white" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
Top