Push notifications to your visitors with a toast, a lightweight and easily customizable alert message.
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.
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.
A Toast can also automatically hide after X milliseconds using the autohide prop with the delay prop to specify the delay. To open the toast, manually change the show property.
A Callback fired when the close button is clicked.
show
boolean
true
When true The modal will show itself.
transition
elementType
<ToastFade>
A react-transition-group Transition component used to animate the Toast on dismissal.
bsPrefix
string
'toast'
Change the underlying component CSS base class name and modifier class names prefix. This is an escape hatch for working with heavily customized bootstrap css.
import ToastHeader from 'react-bootstrap/ToastHeader'Copy import code for the ToastHeader component
Name
Type
Default
Description
closeButton
boolean
true
Specify whether the Component should contain a close button
closeLabel
string
'Close'
Provides an accessible label for the close
button. It is used for Assistive Technology when the label text is not
readable.
closeVariant
'white'
Sets the variant for close button.
bsPrefix
string
Change the underlying component CSS base class name and modifier class names prefix. This is an escape hatch for working with heavily customized bootstrap css.
import ToastBody from 'react-bootstrap/ToastBody'Copy import code for the ToastBody component
Name
Type
Default
Description
as
elementType
<div>
You can use a custom element type for this component.
bsPrefix required
string
'toast-body'
Change the underlying component CSS base class name and modifier class names prefix. This is an escape hatch for working with heavily customized bootstrap css.
import ToastContainer from 'react-bootstrap/ToastContainer'Copy import code for the ToastContainer component
Name
Type
Default
Description
containerPosition
string
'absolute'
By default the container is rendered with position-absolute utility class. Provide a string to use other position-* utility classes, or an empty string to remove it.
Where the toasts will be placed within the container.
bsPrefix
string
'toast-container'
Change the underlying component CSS base class name and modifier class names prefix. This is an escape hatch for working with heavily customized bootstrap css.