🤩
Windframe Import update is finally here!

Notification

Bootstrap 5 Notification

With a toast, a lightweight and easily customized alert message, Bootstrap 5 notifications is used to send information to your visitors.

Toasts are little notifications that are meant to look like the push notifications that have become popular on mobile and desktop platforms. Because they're made with flexbox, they're simple to align and place.

Custom Notification Types

Bootstrap Notification Custom

html
html
<div class="notification mb-3" id="dismiss1">
<div class="notification-header">
<div class="icon-box"><i class="fa fa-square"></i></div>
<div class="d-flex flex-column">
<strong class="ml-3">Contrast</strong>
<small class="ml-3 small-text">11 mins ago</small>
</div>
<button type="button" class="btn p-0 ml-auto h-25">
<button class="btn-close btn-close1" data-dismiss="toast"></button>
</button>
<div class="toggle">
<span
data-toggle="collapse"
data-target="#collapseOne"
aria-expanded="true"
aria-controls="collapseOne"
></span>
</div>
</div>
<div class="notification-message" id="collapseOne">
Hello, world! This is a dismissible message.
</div>
</div>
<div class="notification" id="dismiss2">
<div class="notification-header">
<div class="icon-box"><i class="fa fa-square"></i></div>
<div class="d-flex flex-column">
<strong class="ml-3">Contrast</strong>
<small class="ml-3 small-text">11 mins ago</small>
</div>
<button type="button" class="btn p-0 ml-auto h-25">
<button class="btn-close" data-dismiss="toast"></button>
</button>
<div class="toggle">
<span
data-toggle="collapse"
data-target="#collapseOne"
aria-expanded="true"
aria-controls="collapseOne"
></span>
</div>
</div>
<div class="notification-message" id="collapseOne">
Hello, world! This message will dissapear in 5 seconds.
</div>
</div>

Change Color of Icon Box

Bootstrap Notification Icon Color

html
html
<div class="notification mb-3">
<div class="notification-header">
<div class="icon-box bg-info">
<i class="fa fa-square text-white"></i>
</div>
<div class="d-flex flex-column">
<strong class="ml-3">Contrast</strong>
<small class="ml-3 small-text">11 mins ago</small>
</div>
<button type="button" class="btn p-0 ml-auto h-25">
<button class="btn-close" data-dismiss="toast"></button>
</button>
<div class="toggle">
<span
data-toggle="collapse"
data-target="#collapseTwo"
aria-expanded="true"
aria-controls="collapseTwo"
></span>
</div>
</div>
<div class="notification-message" id="collapseTwo">
Hello, world! This is a primary message.
</div>
</div>
<div class="notification mb-3">
<div class="notification-header">
<div class="icon-box bg-danger">
<i class="fa fa-square text-white"></i>
</div>
<div class="d-flex flex-column">
<strong class="ml-3">Contrast</strong>
<small class="ml-3 small-text">11 mins ago</small>
</div>
<button type="button" class="btn p-0 ml-auto h-25">
<button class="btn-close" data-dismiss="toast"></button>
</button>
<div class="toggle">
<span
data-toggle="collapse"
data-target="#collapseThree"
aria-expanded="true"
aria-controls="collapseThree"
></span>
</div>
</div>
<div class="notification-message" id="collapseThree">
Hello, world! This is a primary message.
</div>
</div>
<div class="notification mb-3">
<div class="notification-header">
<div class="icon-box bg-secondary">
<i class="fa fa-square text-white"></i>
</div>
<div class="d-flex flex-column">
<strong class="ml-3">Contrast</strong>
<small class="ml-3 small-text">11 mins ago</small>
</div>
<button type="button" class="btn p-0 ml-auto h-25">
<button class="btn-close" data-dismiss="toast"></button>
</button>
<div class="toggle">
<span
data-toggle="collapse"
data-target="#collapseFour"
aria-expanded="true"
aria-controls="collapseFour"
></span>
</div>
</div>
<div class="notification-message" id="collapseFour">
Hello, world! This is a primary message.
</div>
</div>

Notification with Icons

Bootstrap Notifications with Icons

html
html
<div class="notification mb-3">
<div class="notification-header">
<div class="icon-box bg-dark">
<i class="fa fa-cut text-white"></i>
</div>
<div class="d-flex flex-column">
<strong class="ml-3">Contrast</strong>
<small class="ml-3 small-text">11 mins ago</small>
</div>
<button type="button" class="btn p-0 ml-auto h-25">
<button class="btn-close" data-dismiss="toast"></button>
</button>
<div class="toggle">
<span
data-toggle="collapse"
data-target="#collapseFive"
aria-expanded="true"
aria-controls="collapseFive"
></span>
</div>
</div>
<div class="notification-message" id="collapseFive">
Hello, world! This is a primary message.
</div>
</div>
<div class="notification mb-3">
<div class="notification-header">
<div class="icon-box bg-dark">
<i class="fa fa-car text-primary"></i>
</div>
<div class="d-flex flex-column">
<strong class="ml-3">Contrast</strong>
<small class="ml-3 small-text">11 mins ago</small>
</div>
<button type="button" class="btn p-0 ml-auto h-25">
<button class="btn-close" data-dismiss="toast"></button>
</button>
<div class="toggle">
<span
data-toggle="collapse"
data-target="#collapseSix"
aria-expanded="true"
aria-controls="collapseSix"
></span>
</div>
</div>
<div class="notification-message" id="collapseSix">
Hello, world! This is a primary message.
</div>
</div>
<div class="notification mb-3">
<div class="notification-header">
<div class="icon-box bg-dark">
<i class="fa fa-compass text-danger"></i>
</div>
<div class="d-flex flex-column">
<strong class="ml-3">Contrast</strong>
<small class="ml-3 small-text">11 mins ago</small>
</div>
<button type="button" class="btn p-0 ml-auto h-25">
<button class="btn-close" data-dismiss="toast"></button>
</button>
<div class="toggle">
<span
data-toggle="collapse"
data-target="#collapseSeven"
aria-expanded="true"
aria-controls="collapseSeven"
></span>
</div>
</div>
<div class="notification-message" id="collapseSeven">
Hello, world! This is a primary message.
</div>
</div>
<div class="notification mb-3">
<div class="notification-header">
<div class="icon-box bg-dark">
<i class="fa fa-train text-success"></i>
</div>
<div class="d-flex flex-column">
<strong class="ml-3">Contrast</strong>
<small class="ml-3 small-text">11 mins ago</small>
</div>
<button type="button" class="btn p-0 ml-auto h-25">
<button class="btn-close" data-dismiss="toast"></button>
</button>
<div class="toggle">
<span
data-toggle="collapse"
data-target="#collapseEight"
aria-expanded="true"
aria-controls="collapseEight"
></span>
</div>
</div>
<div class="notification-message" id="collapseEight">
Hello, world! This is a primary message.
</div>
</div>
Script
js
<script src="../build/cdbbootstrap.js"></script>
<script>
var toastElList = [].slice.call(
document.querySelectorAll('.notification'),
);
var toastList = toastElList.map(function (toastEl) {
return new CDB.Notification(toastEl, { sticky: true });
});
const notificationId = document.querySelector('#dismiss1');
const notification1 = new CDB.Notification(notificationId, {
sticky: true,
visibleDuration: 2000,
});
const notificationId2 = document.querySelector('#dismiss2');
const notification2 = new CDB.Notification(notificationId2, {
sticky: false,
visibleDuration: 2000,
});
</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