Logo Logo Logo Logo
Alerts
Basic Alerts

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

<div class="alert alert-primary" role="alert">
    This information is for your reference
</div>
<div class="alert alert-secondary" role="alert">
    Check the details before proceeding.
</div>
<div class="alert alert-success" role="alert">
    Your action was successful.
</div>
<div class="alert alert-danger" role="alert">
    There was an error with your action.
</div>
<div class="alert alert-warning" role="alert">
    There might be an issue you need to check.
</div>
<div class="alert alert-info" role="alert">
    Here is some information for you.
</div>
<div class="alert alert-light" role="alert">
    Try out the latest tool added to your dashboard.
</div>
<div class="alert alert-dark mb-0" role="alert">
    Updates are available in your profile settings.
</div>
Outline Alerts

Create outline alerts with Bootstrap using the .alert-outline-* classes. Replace * with a color variant like primary, success, or danger for different outline styles.

<div class="alert alert-outline-primary" role="alert">
    This information is for your reference
</div>
<div class="alert alert-outline-secondary" role="alert">
    Check the details before proceeding.
</div>
<div class="alert alert-outline-success" role="alert">
    Everything is set up and ready to go.
</div>
<div class="alert alert-outline-danger" role="alert">
    We couldn’t process your request. Please try again later.
</div>
<div class="alert alert-outline-warning" role="alert">
    This action will permanently delete the item.
</div>
<div class="alert alert-outline-info" role="alert">
    Scheduled maintenance will occur at midnight.
</div>
<div class="alert alert-outline-light" role="alert">
    You can enable notifications in your profile.
</div>
<div class="alert alert-outline-dark mb-0" role="alert">
    Try out the latest tool added to your dashboard.
</div>
Subtle Alerts

Create outline alerts with Bootstrap using the .alert-subtle-* classes. Replace * with a color variant like primary, success, or danger for different outline styles.

<div class="alert alert-subtle-primary" role="alert">
    A simple primary alert—check it out!
</div>
<div class="alert alert-subtle-secondary" role="alert">
    A simple secondary alert—check it out!
</div>
<div class="alert alert-subtle-success" role="alert">
    A simple success alert—check it out!
</div>
<div class="alert alert-subtle-danger" role="alert">
    A simple danger alert—check it out!
</div>
<div class="alert alert-subtle-warning" role="alert">
    A simple warning alert—check it out!
</div>
<div class="alert alert-subtle-info" role="alert">
    A simple info alert—check it out!
</div>
<div class="alert alert-subtle-light" role="alert">
    A simple light alert—check it out!
</div>
<div class="alert alert-subtle-dark" role="alert">
    A simple dark alert—check it out!
</div>
Left Border Alerts

Add a left border to alerts in Bootstrap using the .alert-border-* class. This class applies a primary color border to the left side of the alert box.

<div class="alert alert-border-primary" role="alert">
    A simple primary alert—check it out!
</div>
<div class="alert alert-border-secondary" role="alert">
    A simple secondary alert—check it out!
</div>
<div class="alert alert-border-success" role="alert">
    A simple success alert—check it out!
</div>
<div class="alert alert-border-danger" role="alert">
    A simple danger alert—check it out!
</div>
<div class="alert alert-border-warning" role="alert">
    A simple warning alert—check it out!
</div>
<div class="alert alert-border-info" role="alert">
    A simple info alert—check it out!
</div>
<div class="alert alert-border-light" role="alert">
    A simple light alert—check it out!
</div>
<div class="alert alert-border-dark" role="alert">
    A simple dark alert—check it out!
</div>
Solid Alerts

Display default alerts in Bootstrap using the .alert class. Add contextual classes like .alert-primary, .alert-success, or .alert-danger for different alert styles.

<div class="alert alert-solid-primary" role="alert">
    A simple primary alert—check it out!
</div>
<div class="alert alert-solid-secondary" role="alert">
    A simple secondary alert—check it out!
</div>
<div class="alert alert-solid-success" role="alert">
    A simple success alert—check it out!
</div>
<div class="alert alert-solid-danger" role="alert">
    A simple danger alert—check it out!
</div>
<div class="alert alert-solid-warning" role="alert">
    A simple warning alert—check it out!
</div>
<div class="alert alert-solid-info" role="alert">
    A simple info alert—check it out!
</div>
<div class="alert alert-solid-light" role="alert">
    A simple light alert—check it out!
</div>
<div class="alert alert-solid-dark mb-0" role="alert">
    A simple dark alert—check it out!
</div>
Link Alerts

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

Additional content

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

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

<div class="alert alert-outline-danger mb-0" role="alert">
    <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>

<div class="alert alert-subtle-warning mb-0" role="alert">
    <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 class="border-warning border-opacity-30 border-top">
    <p class="mb-0">Whenever you need to, be sure to use margin utilities to keep things nice and tidy.</p>
</div>

<div class="alert alert-solid-primary mb-0" role="alert">
    <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 class="border-light border-opacity-20 border-top">
    <p class="mb-0">Whenever you need to, be sure to use margin utilities to keep things nice and tidy.</p>
</div>
Icons Alerts

Similarly, you can use flexbox utilities and Bootstrap Icons to create alerts with icons. Depending on your icons and content, you may want to add more utilities or custom styles.

<div class="alert alert-info d-flex align-items-center mb-0" role="alert">
    <i class="bi bi-info-circle-fill flex-shrink-0 me-2"></i>
    <div>
        An example alert with an icon
    </div>
</div>
<div class="alert alert-outline-success d-flex align-items-center mb-0" role="alert">
    <i class="bi bi-check-circle-fill flex-shrink-0 me-2"></i>
    <div>
        An example success alert with an icon
    </div>
</div>
<div class="alert alert-border-warning d-flex align-items-center mb-0" role="alert">
    <i class="bi bi-exclamation-triangle-fill flex-shrink-0 me-2"></i>
    <div>
        An example warning alert with an icon
    </div>
</div>
<div class="alert alert-subtle-danger d-flex align-items-center mb-0" role="alert">
    <i class="bi bi-exclamation-triangle-fill flex-shrink-0 me-2"></i>
    <div>
        An example danger alert with an icon
    </div>
</div>
Dismissing Alerts

Using the alert JavaScript plugin, it’s possible to dismiss any alert inline.

<div class="alert alert-success alert-dismissible fade show mb-0" role="alert">
    <strong>You’re All Set!</strong> The changes were saved without any issues.
    <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
<div class="alert alert-outline-danger alert-dismissible fade show mb-0" role="alert">
    <strong>Critical Error!</strong> Something went wrong. Contact support if this continues.
    <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
<div class="alert alert-border-warning alert-dismissible fade show mb-0" role="alert">
    <strong>Password Expiring!</strong> Update your password to keep your account secure.
    <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
<div class="alert alert-solid-info alert-dismissible fade show mb-0" role="alert">
    <strong>Upcoming Changes:</strong> Some features may be unavailable during the update.
    <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
Theme Customization

it's time to style according to your choice ..!

Layout

Choose your layout

Vertical
Horizontal
Semi Box
Content Width:
Default
Box
Layout Direction:
RTL
LTR
Layout Mode:
Light
Dark
System
Sidebar Size:
Default
Icon
Sidebar Color:
Light
Dark