--- layout: docs title: Toasts description: Push notifications to your visitors with a toast, a lightweight and easily customizable alert message. group: components toc: true --- Toasts are lightweight notifications designed to mimic the push notifications that have been popularized by mobile and desktop operating systems. They're built with flexbox, so they're easy to align and position. ## Overview Things to know when using the toast plugin: - Toasts are opt-in for performance reasons, so **you must initialize them yourself**. - Toasts will automatically hide if you do not specify `autohide: false`. {{< callout info >}} {{< partial "callout-info-prefersreducedmotion.md" >}} {{< /callout >}} ## Examples ### Basic To encourage extensible and predictable toasts, we recommend a header and body. Toast headers use `display: flex`, allowing easy alignment of content thanks to our margin and flexbox utilities. Toasts are as flexible as you need and have very little required markup. At a minimum, we require a single element to contain your "toasted" content and strongly encourage a dismiss button. {{< example class="bg-light" >}}
Name | Type | Default | Description |
---|---|---|---|
animation |
boolean | true |
Apply a CSS fade transition to the toast |
autohide |
boolean | true |
Auto hide the toast |
delay |
number |
5000
|
Delay hiding the toast (ms) |
Event type | Description |
---|---|
show.bs.toast |
This event fires immediately when the show instance method is called. |
shown.bs.toast |
This event is fired when the toast has been made visible to the user. |
hide.bs.toast |
This event is fired immediately when the hide instance method has been called. |
hidden.bs.toast |
This event is fired when the toast has finished being hidden from the user. |