Modals act as dialog boxes overlaid on top of the page. This allows the user to focus on specific content before returning to the underlying application page.
Modals consist of a header component (with or without a close box), a title component, a body component, and a footer component (plus an optional subheading component below the title).
Examples
Sizes
There are three supported modal sizes: 'lg' (default), 'md', and 'sm'. Use the size property to set the size.
Custom classes to add to the modal’s outermost <div> tag.
fullscreen
Boolean
false
When true, the modal will take up the entire browser window, obscuring all underlying content.
size
String
'lg'
Size of the modal. Options are 'lg', 'md', 'sm'.
Modal.Header
Properties
Property
Type
Default
Description
aria-label
String
'Close'
Provides an accessible label for the close button.
bsClass
String
'modal-header'
Base CSS class and prefix for the component. One should not generally change bsClass except to add new, non-Bootstrap CSS styles to a component.
closeButton
Boolean
false
If true, the modal will display a close button.
Callbacks
Property
Parameters
Description
onHide
Fired when the close button is clicked. If used directly inside a Modal component, onHide events will propagate to the parent Modal’s onHide() function.
Modal.Title
Properties
Property
Type
Default
Description
bsClass
String
'modal-title'
Base CSS class and prefix for the component. One should not generally change bsClass except to add new, non-Bootstrap CSS styles to a component.
componentClass
Element Type
'h4'
Custom element types can be used for this component.
Modal.Subhead
Properties
Property
Type
Default
Description
className
String
Custom classes to add to the sub heading <div> tag.
Modal.Body
Properties
Property
Type
Default
Description
bsClass
String
'modal-body'
Base CSS class and prefix for the component. One should not generally change bsClass except to add new, non-Bootstrap CSS styles to a component.
componentClass
Element Type
'div'
Custom element types can be used for this component.
Modal.Footer
Properties
Property
Type
Default
Description
bsClass
String
'modal-footer'
Base CSS class and prefix for the component. One should not generally change bsClass except to add new, non-Bootstrap CSS styles to a component.
componentClass
Element Type
'div'
Custom element types can be used for this component.