Alerts

Alert messages are used to inform users of the status of their action and help them solve any problems that might have occurred. Good design of alert modals is very important for the overall user experience of a website or app.

Default markup

Depending on the information you need to convey, you can use one of the following types of alert messages - success, info, warning or danger. Using the right type of alert modal will help draw users’ attention to the message and prompt them to take action.

<div class="alert alert-success" role="alert">
  <h4 class="alert-title">Wow! Everything worked!</h4>
  <div class="text-secondary">Your account has been saved!</div>
</div>

Add a link to your alert message to redirect users to the details they need to complete or additional information they should read.

<div class="alert alert-danger m-0">
  This is a danger alert — <a href="#" class="alert-link">check it out</a>!
</div>

Dismissible alerts

Add the x close button to make an alert modal dismissible. Thanks to that, your alert modal will disappear only once the user closes it.

<div class="alert alert-success alert-dismissible" role="alert">
  <div class="d-flex">
    <div>
      <!-- SVG icon from http://tabler-icons.io/i/check -->
      <svg>...</svg>
    </div>
    <div>
      <h4 class="alert-title">Wow! Everything worked!</h4>
      <div class="text-secondary">Your account has been saved!</div>
    </div>
  </div>
  <a class="btn-close" data-bs-dismiss="alert" aria-label="close"></a>
</div>

Alerts with icons

Add an icon to your alert modal to make it more user-friendly and help users easily identify the message.

<div class="alert alert-success" role="alert">
  <div class="d-flex">
    <div>
      <!-- SVG icon from http://tabler-icons.io/i/check -->
      <svg>...</svg>
    </div>
    <div>
      <h4 class="alert-title">Wow! Everything worked!</h4>
      <div class="text-secondary">Your account has been saved!</div>
    </div>
  </div>
</div>
<div class="alert alert-info" role="alert">
  <div class="d-flex">
    <div>
      <!-- SVG icon from http://tabler-icons.io/i/info-circle -->
      <svg>...</svg>
    </div>
    <div>
      <h4 class="alert-title">Did you know?</h4>
      <div class="text-secondary">Here is something that you might like to know.</div>
    </div>
  </div>
</div>
<div class="alert alert-warning" role="alert">
  <div class="d-flex">
    <div>
      <!-- SVG icon from http://tabler-icons.io/i/alert-triangle -->
      <svg>...</svg>
    </div>
    <div>
      <h4 class="alert-title">Uh oh, something went wrong</h4>
      <div class="text-secondary">Sorry! There was a problem with your request.</div>
    </div>
  </div>
</div>
<div class="alert alert-danger" role="alert">
  <div class="d-flex">
    <div>
      <!-- SVG icon from http://tabler-icons.io/i/alert-circle -->
      <svg>...</svg>
    </div>
    <div>
      <h4 class="alert-title">I'm so sorry&hellip;</h4>
      <div class="text-secondary">Your account has been deleted and can't be restored.</div>
    </div>
  </div>
</div>

Alert with avatar

Add an avatar to your alert modal to make it more personalized.

<div class="alert alert-success" role="alert">
  <div class="d-flex">
    <div>
      <span class="avatar float-start me-3"></span>
    </div>
    <div>
      Lorem ipsum dolor sit amet, consectetur adipisicing elit. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Lorem ipsum dolor sit amet, consectetur adipisicing elit.
    </div>
  </div>
</div>
<div class="alert alert-info" role="alert">
  <div class="d-flex">
    <div>
      <span class="avatar float-start me-3">JL</span>
    </div>
    <div>
      Lorem ipsum dolor sit amet, consectetur adipisicing elit. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Lorem ipsum dolor sit amet, consectetur adipisicing elit.
    </div>
  </div>
</div>
<div class="alert alert-warning" role="alert">
  <div class="d-flex">
    <div>
      <span class="avatar float-start me-3"></span>
    </div>
    <div>
      Lorem ipsum dolor sit amet, consectetur adipisicing elit. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Lorem ipsum dolor sit amet, consectetur adipisicing elit.
    </div>
  </div>
</div>
<div class="alert alert-danger" role="alert">
  <div class="d-flex">
    <div>
      <span class="avatar float-start me-3"></span>
    </div>
    <div>
      Lorem ipsum dolor sit amet, consectetur adipisicing elit. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Lorem ipsum dolor sit amet, consectetur adipisicing elit.
    </div>
  </div>
</div>

Alert with buttons

Add primary and secondary buttons to your alert modals if you want users to take a particular action based on the information included in the modal message.

<div class="alert alert-success alert-dismissible" role="alert">
  <h3 class="mb-1">Some Title</h3>
  <p>Lorem ipsum Minim ad pariatur eiusmod ea ut nulla aliqua est quis id dolore minim voluptate.</p>
  <div class="btn-list">
    <a href="#" class="btn btn-success">Okay</a>
    <a href="#" class="btn">Cancel</a>
  </div>
  <a class="btn-close" data-bs-dismiss="alert" aria-label="close"></a>
</div>
<div class="alert alert-info alert-dismissible" role="alert">
  <h3 class="mb-1">Some Title</h3>
  <p>Lorem ipsum Minim ad pariatur eiusmod ea ut nulla aliqua est quis id dolore minim voluptate.</p>
  <div class="btn-list">
    <a href="#" class="btn btn-info">Okay</a>
    <a href="#" class="btn">Cancel</a>
  </div>
  <a class="btn-close" data-bs-dismiss="alert" aria-label="close"></a>
</div>
<div class="alert alert-warning alert-dismissible" role="alert">
  <h3 class="mb-1">Some Title</h3>
  <p>Lorem ipsum Minim ad pariatur eiusmod ea ut nulla aliqua est quis id dolore minim voluptate.</p>
  <div class="btn-list">
    <a href="#" class="btn btn-warning">Okay</a>
    <a href="#" class="btn">Cancel</a>
  </div>
  <a class="btn-close" data-bs-dismiss="alert" aria-label="close"></a>
</div>
<div class="alert alert-danger alert-dismissible" role="alert">
  <h3 class="mb-1">Some Title</h3>
  <p>Lorem ipsum Minim ad pariatur eiusmod ea ut nulla aliqua est quis id dolore minim voluptate.</p>
  <div class="btn-list">
    <a href="#" class="btn btn-danger">Okay</a>
    <a href="#" class="btn">Cancel</a>
  </div>
  <a class="btn-close" data-bs-dismiss="alert" aria-label="close"></a>
</div>

Important alerts

If you want your alert to be really eye-catching, you can add a class alert-important.

<div class="alert alert-important alert-success alert-dismissible" role="alert">
  <div class="d-flex">
    <div>
      <!-- SVG icon from http://tabler-icons.io/i/check -->
      <svg>...</svg>
    </div>
    <div>
      Your account has been saved!
    </div>
  </div>
  <a class="btn-close btn-close-white" data-bs-dismiss="alert" aria-label="close"></a>
</div>
<div class="alert alert-important alert-info alert-dismissible" role="alert">
  <div class="d-flex">
    <div>
      <!-- SVG icon from http://tabler-icons.io/i/info-circle -->
      <svg>...</svg>
    </div>
    <div>
      Here is something that you might like to know.
    </div>
  </div>
  <a class="btn-close btn-close-white" data-bs-dismiss="alert" aria-label="close"></a>
</div>
<div class="alert alert-important alert-warning alert-dismissible" role="alert">
  <div class="d-flex">
    <div>
      <!-- SVG icon from http://tabler-icons.io/i/alert-triangle -->
      <svg>...</svg>
    </div>
    <div>
      Sorry! There was a problem with your request.
    </div>
  </div>
  <a class="btn-close btn-close-white" data-bs-dismiss="alert" aria-label="close"></a>
</div>
<div class="alert alert-important alert-danger alert-dismissible" role="alert">
  <div class="d-flex">
    <div>
      <!-- SVG icon from http://tabler-icons.io/i/alert-circle -->
      <svg>...</svg>
    </div>
    <div>
      Your account has been deleted and can't be restored.
    </div>
  </div>
  <a class="btn-close btn-close-white" data-bs-dismiss="alert" aria-label="close"></a>
</div>
Do you have a question? ask the community
Do you see a bug? open an issue on GitHub
Do you like Tabler? tweet about it!
Support Tabler's development: Github Sponsors
illustrations banner imageillustrations banner image dark
60 sleek illustrations for your startup's visual identity.