Bootstrap Toast component provides an easy way to mimic the functionality of push notifications. Bootstrap Toast is like an alert box that can be displayed to the user whenever an event occurs. This component has been built with CSS flexbox which makes it easy to position and align.
It is not necessary to show the toast on a button click. It can be shown for any type of event that occurs in the browser. Let’s see an example.
Example: Creating Bootstrap Notification/Toast. In this example we will show a push notification when the user scrolls the <div> in the page. To create a bootstrap toast we need to use the toast class on a division and add two divisions inside it with classes toast-header and toast-body. We will show the notification using jquery.
- Before Scrolling the content:
- After Scrolling the content:
- How to place button in top Right corner using bootstrap?
- How to call PHP function on the click of a Button ?
- How to create button dynamically with click event in Angular ?
- How to remove active nav-tab when click outside of nav-tab in Bootstrap ?
- How to make Bootstrap popover appear/disappear on hover instead of click?
- How to add active class on click event in custom list group in Bootstrap 4 ?
- How to set the button alignment in Bootstrap ?
- Bootstrap 4 | Button Groups
- How to change (-, +) symbol with a button in Bootstrap Accordion ?
- How to align button to right side of text box in Bootstrap?
- How to enable Bootstrap tooltip on disabled button ?
- button tag vs input type="button" attribute
- How to pop an alert message box using PHP ?
- How to add a new line in the alert box ?
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.