Modal
Basic example
Toggle a working modal demo by clicking the button below. It will slide down and fade in from the top of the page.
Static backdrop
When backdrop is set to static, the modal will not close when clicking outside of it. Click the button below to try it.
Scrolling long content
When modals become too long for the user’s viewport or device, they scroll independent of the page itself. Try the demo below to see what we mean.
Vertically centered
Add .modal-dialog-centered
to .modal-dialog
to vertically
center the modal.
Toggle between modals
Toggle between multiple modals with some clever placement of the
data-bs-target
and data-bs-toggle
attributes.
Remove animation
For modals that simply appear rather than fade in to view, remove the
.fade
class from your modal markup.
Modal sizes
Modals have three optional sizes, available via modifier classes to be placed on a
.modal-dialog
. These sizes kick in at certain breakpoints to avoid
horizontal scrollbars on narrower viewports.
Fullscreen Modal
Another override is the option to pop up a modal that covers the user viewport,
available via modifier classes that are placed on a
.modal-dialog
.