## Documentation

Browse source code

##### On this page

- Default markup
- Alert links
- Dismissible alerts
- Alerts with icons
- Alert with avatar
- Alert with buttons

## Alerts

Bootstrap documentation

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">
      This is a success alert — check it out!
    </div>
    <div class="alert alert-info" role="alert">
      This is a info alert — check it out!
    </div>
    <div class="alert alert-warning" role="alert">
      This is a warning alert — check it out!
    </div>
    <div class="alert alert-danger" role="alert">
      This is a danger alert — check it out!
    </div>

## Alert links

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-success" role="alert">
      This is a success alert — <a href="#" class="alert-link">check it out</a>!
    </div>
    <div class="alert alert-info" role="alert">
      This is a info alert — <a href="#" class="alert-link">check it out</a>!
    </div>
    <div class="alert alert-warning" role="alert">
      This is a warning alert — <a href="#" class="alert-link">check it out</a>!
    </div>
    <div class="alert alert-danger" role="alert">
      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">
      This is a success alert — check it out!
      <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
    </div>
    <div class="alert alert-info alert-dismissible" role="alert">
      This is a info alert — check it out!
      <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
    </div>
    <div class="alert alert-warning alert-dismissible" role="alert">
      This is a warning alert — check it out!
      <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
    </div>
    <div class="alert alert-danger alert-dismissible" role="alert">
      This is a danger alert — check it out!
      <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</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">
      <!-- SVG icon code -->
      This is a success alert — check it out!
    </div>
    <div class="alert alert-info" role="alert">
      <!-- SVG icon code -->
      This is a info alert — check it out!
    </div>
    <div class="alert alert-warning" role="alert">
      <!-- SVG icon code -->
      This is a warning alert — check it out!
    </div>
    <div class="alert alert-danger" role="alert">
      <!-- SVG icon code -->
      This is a danger alert — check it out!
    </div>

## Alert with avatar

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

    <div class="alert alert-success" role="alert">
      <span class="avatar" style="background-image: url(...)"></span>
      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 class="alert alert-info" role="alert">
      <span class="avatar">JL</span>
      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 class="alert alert-warning" role="alert">
      <span class="avatar" style="background-image: url(...)"></span>
      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 class="alert alert-danger" role="alert">
      <span class="avatar" style="background-image: url(...)"></span>
      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>

## 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>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">Save changes</a>
        <a href="#" class="btn btn-secondary">Cancel</a>
      </div>
      <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
    </div>