A toast is similar to an alert box, used to notify users when something happens. It will only display for a few seconds.
We can create a toast with Bootstrap 4 using the toast
class.
A toast contains a toast-header
and toast-body
, which we need to provide inside the toast
class.
<div>
<div>
This is toast header
</div>
<div>
Inside of toast body
</div>
</div>
Let’s look at the code below:
In the above code:
div
element with the class as toast
. We use this to display toast.div
element and provide content to be displayed in div
.div
element and display content in div
.