Dark Logo

Urbix

CTRL D
Modal View

Below is a static modal example (meaning its position and display have been overridden). Included are the modal header, modal body (required for padding), and modal footer (optional). We ask that you include modal headers with dismiss actions whenever possible, or provide another explicit dismiss action.

Default Modal

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

You can also create a scrollable modal that allows scrolling the modal body by adding .modal-dialog-scrollable to .modal-dialog.

Vertically Centered

Add .modal-dialog-centered to .modal-dialog to vertically center the modal.

Tooltips and popovers

Tooltips and popovers can be placed within modals as needed. When modals are closed, any tooltips and popovers within are also automatically dismissed.

Toggle Between Modals

Toggle between multiple modals with some clever placement of the data-bs-target and data-bs-toggle attributes. For example, you could toggle a password reset modal from within an already open sign in modal. Please note multiple modals cannot be open at the same time—this method simply toggles between two separate modals.

Varying Modal Content

Have a bunch of buttons that all trigger the same modal with slightly different contents? Use event.relatedTarget and HTML data-bs-* attributes to vary the contents of the modal depending on which button was clicked.

Below is a live demo followed by example HTML and JavaScript. For more information, read the modal events docs for details on relatedTarget.

Modal Size

Adjust the size of a Bootstrap modal by adding size-specific classes like .modal-sm for small, .modal-lg for large, or .modal-xl for extra-large to the <div class="modal-dialog">.

Fullscreen Modals Example

Handle long content in a Bootstrap modal by adding .modal-dialog-scrollable to the <div class="modal-dialog">. This allows the modal body to scroll while keeping the header and footer fixed.

Class Availability
.modal-fullscreen Always
.modal-fullscreen-sm-down 576px
.modal-fullscreen-md-down 768px
.modal-fullscreen-lg-down 992px
.modal-fullscreen-xl-down 1200px
.modal-fullscreen-xxl-down 1400px
Draggable Modal

Make a Bootstrap modal draggable by adding the data-draggable="true" attribute to the <div class="modal"> element. This allows users to move the modal around the screen.

Animated Modal

Choose an animation from the dropdown and click Show Modal to see the Bootstrap modal open with a smooth animation effect.

Theme Customization

Layout:
Vertical
Horizontal
Semi Box
Content Width:
Default
Box
Layout Direction:
LTR
RTL
Layout Mode:
Light
Dark
System
Sidebar Size:
Default
Medium
Icon
Icon hover
Sidebar Color:
Light
Dark