Bootstrap 4 toast is basically a small alert box that appears for a couple of seconds whenever the user clicks on any link or submits a form.
.toast
class to the toast container i.e parent container of toast..toast-header
class inside .toast
element direct children..toast-body
class inside .toast
element last children.Toast is a small alert box that will be visible for a couple of seconds whenever the user clicks on any link, button, or submit the
Note: In this example, bootstrap toast is initialized by the bootstrap toast method using jquery.
Bootstrap toast is a small alert box that pops up whenever users click on any link, button, or submit forms.
Bootstrap toast is hidden by default but it can be shown by using data-autohide="false"
data attribute.To close this toast ,use a <button>
element and assign it to data-dismiss="toast"
.
Note:
In this example, bootstrap data-autohide="false"
attribute is used to show the toast.