import Alert from 'react-bootstrap/Alert'Copy import code for the Alert component
Name
Type
Default
Description
closeLabel
string
'Close alert'
Sets the text for alert close button.
closeVariant
'white'
Sets the variant for close button.
dismissible
boolean
Renders a properly aligned dismiss button, as well as
adding extra horizontal padding to the Alert.
onClose
function
controls show
Callback fired when alert is closed.
show
boolean
true
controlled by: onClose, initial prop: defaultShow
Controls the visual state of the Alert.
transition
boolean | elementType
Fade
Animate the alert dismissal. Defaults to using <Fade> animation or use
false to disable. A custom react-transition-group Transition can also
be provided.
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 Alert from 'react-bootstrap/Alert'Copy import code for the Alert component
Name
Type
Default
Description
as
elementType
<DivStyledAsH4>
You can use a custom element type for this component.
bsPrefix required
string
'alert-heading'
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 Alert from 'react-bootstrap/Alert'Copy import code for the Alert component
Name
Type
Default
Description
as
elementType
<Anchor>
You can use a custom element type for this component.
bsPrefix required
string
'alert-link'
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.