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.
Toasts are slightly translucent to blend in with what's below them.
You can stack toasts by wrapping them in a toast container, which will vertically add some spacing.
Customize your toasts by removing sub-components, tweaking them with utilities, or by adding your own markup. Here we've created a simpler toast by removing the default <CToastHeader>
, adding a custom hide icon from CoreUI Icons, and using some flexbox utilities to adjust the layout.
Alternatively, you can also add additional controls and components to toasts.
Building on the above example, you can create different toast color schemes with our color and background utilities. Here we've set color="primary"
and added .text-white
class to the <Ctoast>
, and then set white
property to our close button. For a crisp edge, we remove the default border with .border-0
.