How it works

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.
Basic Example
Stacking

You can stack toasts by wrapping them in a toast container, which will vertically add some spacing.

Custom content

Customize your toasts by removing sub-components, tweaking with utilities, or adding your own markup. Here we’ve created a simpler toast by removing the default .toast-header, adding a custom hide icon from Bootstrap Icons, and using some flexbox utilities to adjust the layout.

Building on the above example, you can create different toast color schemes with our color utilities. Here we’ve added .bg-primary and .text-white to the .toast, and then added .text-white to our close button. For a crisp edge, we remove the default border with .border-0.

Alternatively, you can also add additional controls and components to toasts.