🤩
Windframe Import Update is finally here.

Alert

Bootstrap 5 Alert

Bootstrap 5 Alerts are used to send feedback messages to users after they perform particular activities.

Bootstrap 5 Alerts come with an optional dismiss button and may be used with any amount of text. Use one of the contextual props (e.g., color="success") for suitable style. Use the dismiss prop for inline dismissal.

Bootstrap Alerts

Default Alert

We may use the Bootstrap Alert Component to give our div element the alert class. As a result, our div element becomes an alert. We can also give several backdrop colors for our alerts by giving our div a class of alert and attaching the various color keywords ( primary, secondary, success, etc.).

html
html
<div class="alert alert-primary" style="width: fit-content" role="alert">
A simple alert built with contrast design check it out!
</div>
<div class="alert alert-secondary" style="width: fit-content" role="alert">
A simple alert built with contrast design check it out!
</div>
<div class="alert alert-success" style="width: fit-content" role="alert">
A simple alert built with contrast design check it out!
</div>
<div class="alert alert-danger" style="width: fit-content" role="alert">
A simple alert built with contrast design check it out!
</div>
<div class="alert alert-warning" style="width: fit-content" role="alert">
A simple alert built with contrast design check it out!
</div>
<div class="alert alert-info" style="width: fit-content" role="alert">
A simple alert built with contrast design check it out!
</div>
<div class="alert alert-dark" style="width: fit-content" role="alert">
A simple alert built with contrast design check it out!
</div>

Dismissable Alert Button

Bootstrap Dismissable Alert Button

HTML
html
<div class="alert alert-warning alert-dismissible fade show" role="alert">
<strong>Holy guacamole!</strong> You should check in on some of those fields below.
<button type="button" class="btn-close" data-dismiss="alert" aria-label="Close"></button>
</div>

Dismissable Alert Button with Javascript

image info

HTML
html
<div
class="alert alert-warning alert-dismissible fade show"
id="alert1"
role="alert"
>
Hey Dismiss me using Javascript
</div>
<button id="dismiss1" class="btn btn-dark btn-flat mt-4">
Dismiss Alert
</button>
</div>
Script
js
<script>
document.querySelector('#dismiss1').addEventListener('click', () => {
var alertNode = document.querySelector('#alert1');
var alert = new bootstrap.Alert(alertNode);
alert.close();
});
</script>

Trying to build out all user interfaces and components for your website or web app from scratch can become a very tedious task. A huge reason why we created Contrast Bootstrap to help reduce the amount of time we spend doing that, so we can focus on building some other aspects of the project. Contrast Bootstrap PRO consists of a UI Kit featuring over 10000+ component variants. Together with a template of 5 admin dashboards and 23+ additional multipurpose pages template for building almost any type of website or web app. You can view a demo and learn more about Contrast by clicking here.Download the free react template

ad-banner

Contrast Bootstrap PRO was built using the most popular CSS framework Bootstrap to help build your next landing, admin SAAS, prelaunch etc project with a clean, prebuilt and well documented template and UI components.Learn more about Contrast