Provide contextual feedback messages for typical user actions with the handful of available and flexible alert messages.
UsageNg Notify
Use .Alert class
, followed by one of the contextual classes .Alert-success
, .Alert-info
, .Alert-warning
, .Alert-danger
, .Alert-primary
, .Alert-secondary
, .Alert-light
or .Alert-dark
to create an alert.
<div role="alert" class="Alert Alert-primary">
<div class="Alert-text">A simple Primary alert—check it out!</div>
</div>
With .Alert-pill
class.
<div role="alert" class="Alert Alert-pill Alert-primary">
<div class="Alert-text">A simple Primary alert with `.Alert-pill` class.</div>
</div>
With .Alert-outline
class.
<div role="alert" class="Alert Alert-outline Alert-primary">
<div class="Alert-text">A simple Primary alert with `.Alert-outline` class.</div>
</div>
With .Bg-gradient
class.
<div role="alert" class="Alert Alert-primary Bg-gradient">
<div class="Alert-text">A simple Primary alert with `.Bg-gradient` class.</div>
</div>
With .Alert-blurry
class.
<div class="Alert Alert-blurry Alert-dismissible Alert-success D-flex Align-items-center" role="alert">
<div class="Alert-icon"><i class="fa-solid fa-check"></i></div>
<div class="Alert-text">A simple Success alert with `.Alert-blurry` class.</div>
</div>
Alerts can contain additional elements like headings, paragraphs and dividers.
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.
Whenever you need to, be sure to use margin utilities to keep things nice and tidy.
<div class="Alert Alert-success" role="alert">
<div class="Alert-text">
<h5 class="Alert-heading">Well done!</h5>
<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>
<div class="Alert Alert-danger" role="alert">
<div class="Alert-text">
<h5 class="Alert-heading">Danger!</h5>
<span>A simple Danger alert—check it out!</span>
</div>
</div>
Use Font Awesome 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 D-flex Align-items-center" role="alert">
<div class="Alert-icon"><i class="fa-solid fa-bell"></i></div>
<div class="Alert-text">An example alert with an icon</div>
</div>
<div class="Alert Alert-success D-flex Align-items-center" role="alert">
<div class="Alert-icon"><i class="fa-solid fa-check"></i></div>
<div class="Alert-text">An example success alert with an icon</div>
</div>
With close button, icon, progress bar and countdown!
<div class="Alert Alert-dismissible Alert-success D-flex Align-items-center" role="alert">
<div class="Alert-icon"><i class="fa-solid fa-check"></i></div>
<div class="Alert-text">
<div class="Alert-heading FW-bolder FS-6">Success!</div>
<span>A simple success alert—check it out!</span>
</div>
<div>
<div class="Countdown">00:00</div>
<button class="Btn-close"></button>
<div class="Progress" style="height: 3px;">
<span class="Progress-bar W-66"></span>
</div>
</div>
</div>
<div class="W-100 W-lg-60 MX-auto">
<div class="Alert Alert-dismissible D-flex Align-items-center" role="alert">
<div class="Alert-icon">
<div class="Square" style="min-width: 75px;">
<div class="Centered">
<div class="Spinner-vortex">
@for (_ of [1,2,3,4,5,6,7,8]; track $index){
<span></span>
}
</div>
</div>
</div>
</div>
<div class="Alert-text">A simple alert—check it out!</div>
<div>
<div class="Countdown">00:00</div>
<button class="Btn-close"></button>
<div class="Progress" style="height: 3px;">
<span class="Progress-bar W-66"></span>
</div>
</div>
</div>
</div>