Use Bootstrap’s JavaScript modal plugin to add dialogs to your site for lightboxes, user notifications, or
completely custom content.
Read the official
Bootstrap Documentation for a full list of
instructions and other options.
Toggle a working modal demo by clicking the button below. It will slide up and fade in from the center of the page.
Croissant jelly beans donut apple pie. Caramels bonbon lemon drops. Sesame snaps lemon drops lemon drops liquorice icing bonbon pastry pastry carrot cake. Dragée sweet sweet roll sugar plum.
Jelly-o cookie jelly gummies pudding cheesecake lollipop macaroon. Sweet chocolate bar sweet roll carrot cake. Sweet roll sesame snaps fruitcake brownie bear claw toffee bonbon brownie.
<!-- Button trigger modal -->
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#exampleModal">
Launch demo modal
</button>
<!-- Modal -->
<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Modal title</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close">
</button>
</div>
<div class="modal-body">
<p>Croissant jelly beans donut apple pie. Caramels bonbon lemon drops. Sesame snaps lemon drops lemon drops liquorice icing bonbon pastry pastry carrot cake. Dragée sweet sweet roll sugar plum.</p>
<p>Jelly-o cookie jelly gummies pudding cheesecake lollipop macaroon. Sweet chocolate bar sweet roll carrot cake. Sweet roll sesame snaps fruitcake brownie bear claw toffee bonbon brownie.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
</div>
Add .modal-dialog-centered
to .modal-dialog
to vertically center the modal.
<!-- Button trigger modal -->
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#basicModal">
Launch modal
</button>
<!-- Modal -->
<div class="modal fade" id="basicModal" tabindex="-1" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel1">Modal title</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="row">
<div class="col mb-6">
<label for="nameBasic" class="form-label">Name</label>
<input type="text" id="nameBasic" class="form-control" placeholder="Enter Name">
</div>
</div>
<div class="row g-6">
<div class="col mb-0">
<label for="emailBasic" class="form-label">Email</label>
<input type="email" id="emailBasic" class="form-control" placeholder="xxxx@xxx.xx">
</div>
<div class="col mb-0">
<label for="dobBasic" class="form-label">DOB</label>
<input type="date" id="dobBasic" class="form-control" >
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-label-secondary" data-bs-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
</div>
Use data-theVideo
data attribute with button to launch the video in modal.
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#youTubeModal" data-theVideo="https://www.youtube.com/embed/EngW7tLk6R8">
Launch modal
</button>
<!-- Modal -->
<div class="modal fade" id="youTubeModal" tabindex="-1" aria-labelledby="youTubeModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<iframe width="100%" height="350" src=""></iframe>
</div>
</div>
</div>
// Function to get and auto play youTube video
const autoPlayYouTubeModal = function() {
const modalTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="modal"]'));
modalTriggerList.map(function(modalTriggerEl) {
modalTriggerEl.onclick = function() {
const theModal = this.getAttribute('data-bs-target'),
videoSRC = this.getAttribute('data-theVideo'),
videoSRCauto = `${videoSRC}?autoplay=1`,
modalVideo = document.querySelector(`${theModal} iframe`);
if (modalVideo) {
modalVideo.setAttribute('src', videoSRCauto);
}
};
});
};
// Calling function on load
autoPlayYouTubeModal();
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.
You can also create a scrollable modal that allows scroll the modal body by adding .modal-dialog-scrollable
to .modal-dialog
.
Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.
Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.
Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.
Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.
Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.
Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.
Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.
Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.
Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.
Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.
Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.
Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.
Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.
Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.
Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.
Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.
Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.
Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.
Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.
Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.
Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.
Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.
Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.
Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.
Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.
Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.
Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.
Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.
Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.
Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.
Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.
Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.
Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.
Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.
Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.
Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.
<!-- Modal with long content -->
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#modalLong">
Option 1
</button>
<!-- Modal -->
<div class="modal fade" id="modalLong" tabindex="-1" aria-labelledby="modalLongTitle" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="modalLongTitle">Modal title</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close">
</button>
</div>
<div class="modal-body">
...
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
</div>
<!-- Modal with scrollable content -->
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#modalScrollable">
Option 2
</button>
<!-- Modal -->
<div class="modal fade" id="modalScrollable" tabindex="-1" aria-labelledby="modalScrollableTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-scrollable" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="modalScrollableTitle">Modal title</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close">
</button>
</div>
<div class="modal-body">
...
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
</div>
Add data-bs-backdrop="static"
data attribute with .modal
to remove modal backdrop. Alternatively, specify static for a backdrop which doesn't close the modal on outside click.
<!-- Button trigger modal -->
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#backDropModal">
Launch modal
</button>
<!-- Modal -->
<div class="modal fade" id="backDropModal" data-bs-backdrop="static" tabindex="-1">
<div class="modal-dialog">
<form class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="backDropModalTitle">Modal title</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="row">
<div class="col mb-6">
<label for="nameBackdrop" class="form-label">Name</label>
<input type="text" id="nameBackdrop" class="form-control" placeholder="Enter Name">
</div>
</div>
<div class="row g-6">
<div class="col mb-0">
<label for="emailBackdrop" class="form-label">Email</label>
<input type="email" id="emailBackdrop" class="form-control" placeholder="xxxx@xxx.xx">
</div>
<div class="col mb-0">
<label for="dobBackdrop" class="form-label">DOB</label>
<input type="date" id="dobBackdrop" class="form-control" >
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-label-secondary" data-bs-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save</button>
</div>
</form>
</div>
</div>
Toggle between multiple modals with some clever placement of the data-bs-target
and data-bs-toggle
attributes. Please note multiple modals cannot be open at the same time—this method simply toggles between two separate modals.
<!-- Button trigger modal -->
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#modalToggle">
Launch modal
</button>
<!-- Modal 1-->
<div class="modal fade" id="modalToggle" aria-labelledby="modalToggleLabel" tabindex="-1" style="display: none;" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="modalToggleLabel">Modal 1</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
Show a second modal and hide this one with the button below.
</div>
<div class="modal-footer">
<button class="btn btn-primary" data-bs-target="#modalToggle2" data-bs-toggle="modal" data-bs-dismiss="modal">Open second modal</button>
</div>
</div>
</div>
</div>
<!-- Modal 2-->
<div class="modal fade" id="modalToggle2" aria-hidden="true" aria-labelledby="modalToggleLabel2" tabindex="-1">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="modalToggleLabel2">Modal 2</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
Hide this modal and show the first with the button below.
</div>
<div class="modal-footer">
<button class="btn btn-primary" data-bs-dismiss="modal">Back to first</button>
</div>
</div>
</div>
</div>
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
. Use .modal-fullscreen
to always have modal with fullscreen and .modal-fullscreen-{sm|md|lg|xl|xxl}-down
to have fullscreen modal for some screen sizes.
Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.
Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.
Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.
Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.
Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.
Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.
Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.
Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.
Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.
Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.
Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.
Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.
Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.
Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.
Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.
Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.
Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.
Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#fullscreenModal">
Launch modal
</button>
<!-- Modal -->
<div class="modal fade" id="fullscreenModal" tabindex="-1" aria-hidden="true">
<div class="modal-dialog modal-fullscreen" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="modalFullTitle">Modal title</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<p>...</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-label-secondary" data-bs-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
</div>
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.
Sizing classes will be .modal-{sm|lg|xl}
with .modal-dialog
class.
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#smallModal">
Small
</button>
<!-- Small Modal -->
<div class="modal fade" id="smallModal" tabindex="-1" aria-hidden="true">
<div class="modal-dialog modal-sm" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel2">Modal title</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="row">
<div class="col mb-6">
<label for="nameSmall" class="form-label">Name</label>
<input type="text" id="nameSmall" class="form-control" placeholder="Enter Name">
</div>
</div>
<div class="row g-6">
<div class="col mb-0">
<label class="form-label" for="emailSmall">Email</label>
<input type="email" class="form-control" id="emailSmall" placeholder="xxxx@xxx.xx">
</div>
<div class="col mb-0">
<label for="dobSmall" class="form-label">DOB</label>
<input id="dobSmall" type="date" class="form-control">
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-label-secondary" data-bs-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
</div>
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#defaultModal">
Defalut
</button>
<!-- Defalut Modal -->
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#basicModal">
Default
</button>
<!-- Modal -->
<div class="modal fade" id="basicModal" tabindex="-1" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel1">Modal title</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="row">
<div class="col mb-6">
<label for="nameBasic" class="form-label">Name</label>
<input type="text" id="nameBasic" class="form-control" placeholder="Enter Name">
</div>
</div>
<div class="row g-6">
<div class="col mb-0">
<label for="emailBasic" class="form-label">Email</label>
<input type="email" id="emailBasic" class="form-control" placeholder="xxxx@xxx.xx">
</div>
<div class="col mb-0">
<label for="dobBasic" class="form-label">DOB</label>
<input type="date" id="dobB" class="form-control">
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-label-secondary" data-bs-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
</div>
<!-- Large Modal -->
<div class="modal fade" id="largeModal" tabindex="-1" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel3">Modal title</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="row">
<div class="col mb-6">
<label for="nameLarge" class="form-label">Name</label>
<input type="text" id="nameLarge" class="form-control" placeholder="Enter Name">
</div>
</div>
<div class="row g-6">
<div class="col mb-0">
<label for="emailLarge" class="form-label">Email</label>
<input type="email" id="emailLarge" class="form-control" placeholder="xxxx@xxx.xx">
</div>
<div class="col mb-0">
<label for="dobLarge" class="form-label">DOB</label>
<input type="date" id="dobL" class="form-control">
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-label-secondary" data-bs-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
</div>
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#exLargeModal">
Extra Large
</button>
<!-- Extra Large Modal -->
<div class="modal fade" id="exLargeModal" tabindex="-1" aria-hidden="true">
<div class="modal-dialog modal-xl" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel4">Modal title</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="row">
<div class="col mb-6">
<label for="nameExLarge" class="form-label">Name</label>
<input type="text" id="nameExLarge" class="form-control" placeholder="Enter Name">
</div>
</div>
<div class="row g-6">
<div class="col mb-0">
<label for="emailExLarge" class="form-label">Email</label>
<input type="email" id="emailExLarge" class="form-control" placeholder="xxxx@xxx.xx">
</div>
<div class="col mb-0">
<label for="dobExLarge" class="form-label">DOB</label>
<input type="date" id="dobExLarge" class="form-control" >
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-label-secondary" data-bs-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
</div>
Here we are providing few examples of animation, we are using
animate.css to add different animation to
modal. You can add different animation classes with .animate__animated
class to modal.
For modals that simply appear rather than fade in to view, remove the .fade
class from your
modal markup.
In order to use extra animations on your page, It is required to include the following vendors css in the "Vendors CSS" area from the page's header
<link rel="stylesheet" href="vendor/libs/animate-css/animate.css">
<!-- Button trigger modal -->
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#swinganimationModal">
Swing
</button>
<!-- Modal -->
<div class="modal animate__animated animate__swing" id="swinganimationModal" tabindex="-1" aria-labelledby="swinganimationModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Modal title</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close">
</button>
</div>
<div class="modal-body">
<div class="row">
<div class="mb-3 col">
<label for="nameSwing" class="form-label">Name</label>
<input type="text" id="nameSwing" class="form-control" placeholder="Enter Name">
</div>
</div>
<div class="row">
<div class="mb-3 col mb-0">
<label for="emailSwing" class="form-label">Email</label>
<input type="email" id="emailSwing" class="form-control" placeholder="xxxx@xxx.xx">
</div>
<div class="mb-3 col mb-0">
<label for="dobSwing" class="form-label">DOB</label>
<input type="date" id="dobSwing" class="form-control">
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
</div>
<!-- Button trigger modal -->
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#flipInXAnimationModal">
FlipInX
</button>
<!-- Modal -->
<div class="modal animate__animated animate__flipInX" id="flipInXAnimationModal" tabindex="-1" aria-labelledby="flipInXAnimationModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Modal title</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close">
</button>
</div>
<div class="modal-body">
<div class="row">
<div class="mb-3 col">
<label for="nameFlipInX" class="form-label">Name</label>
<input type="text" id="nameFlipInX" class="form-control" placeholder="Enter Name">
</div>
</div>
<div class="row">
<div class="mb-3 col mb-0">
<label for="emailFlipInX" class="form-label">Email</label>
<input type="email" id="emailFlipInX" class="form-control" placeholder="xxxx@xxx.xx">
</div>
<div class="mb-3 col mb-0">
<label for="dobFlipInX" class="form-label">DOB</label>
<input type="date" id="dobFlipInX" class="form-control" >
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
</div>
To slide Modal from top use .modal-top
class with .modal
class.
<!-- Button trigger modal -->
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#modalTop">
Launch modal
</button>
<!-- Modal -->
<div class="modal modal-top fade" id="modalTop" tabindex="-1">
<div class="modal-dialog">
<form class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="modalTopTitle">Modal title</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="row">
<div class="col mb-6">
<label for="nameSlideTop" class="form-label">Name</label>
<input type="text" id="nameSlideTop" class="form-control" placeholder="Enter Name">
</div>
</div>
<div class="row g-6">
<div class="col mb-0">
<label for="emailSlideTop" class="form-label">Email</label>
<input type="email" id="emailSlideTop" class="form-control" placeholder="xxxx@xxx.xx">
</div>
<div class="col mb-0">
<label for="dobSlideTop" class="form-label">DOB</label>
<input type="date" id="dobSlideTop" class="form-control">
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-label-secondary" data-bs-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save</button>
</div>
</form>
</div>
</div>
Use .modal-transparent
class with .modal
class for transparent modal.
<!-- Button trigger modal -->
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#modals-transparent">
Transparent Modal
</button>
<!-- Modal -->
<div class="modal modal-transparent fade" id="modals-transparent" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-body">
<a href="javascript:void(0);" class="btn-close text-white" data-bs-dismiss="modal" aria-label="Close"></a>
<p class="text-white text-large fw-light mb-4">Subscribe to get latest updates</p>
<div class="input-group input-group-lg mb-4">
<input type="text" class="form-control bg-white border-0" placeholder="Your email" aria-describedby="subscribe">
<button class="btn btn-primary" type="button" id="subscribe">Subscribe</button>
</div>
<div class="text-start text-white">We won't share your email address</div>
</div>
</div>
</div>
</div>
These onboarding modals options are the perfect way to introduce your customers with your web application or you can also collect additional information from them. We have two layouts available: Vertical and Horizontal.
<!-- Vertical slider modal -->
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#onboardingSlideModal">Vertical Slider modal</button>
<div class="modal-onboarding modal fade animate__animated" id="onboardingSlideModal" tabindex="-1" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content text-center">
<div class="modal-header border-0">
<a class="text-muted close-label" href="javascript:void(0);" data-bs-dismiss="modal">Skip Intro</a>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close">
</button>
</div>
<div id="modalCarouselControls" class="carousel slide pb-6 mb-2" data-bs-interval="false">
<div class="carousel-indicators">
<button type="button" data-bs-target="#modalCarouselControls" data-bs-slide-to="0" class="active"></button>
<button type="button" data-bs-target="#modalCarouselControls" data-bs-slide-to="1"></button>
<button type="button" data-bs-target="#modalCarouselControls" data-bs-slide-to="2"></button>
</div>
<div class="carousel-inner">
<div class="carousel-item active">
<div class="onboarding-media">
<div class="mx-2">
<img src="assets/img/illustrations/girl-with-laptop-light.png" alt="girl-with-laptop-light" width="335" class="img-fluid">
</div>
</div>
<div class="onboarding-content">
<h4 class="onboarding-title text-body">Example Request Information</h4>
<div class="onboarding-info">In this example you can see a form where you can request some
additional information from the customer when they land on the app page.</div>
<form>
<div class="row">
<div class="col-sm-6">
<div class="mb-3">
<label for="nameEx" class="form-label">Your Full Name</label>
<input class="form-control" placeholder="Enter your full name..." type="text" value="" tabindex="0" id="nameEx">
</div>
</div>
<div class="col-sm-6">
<div class="mb-3">
<label for="roleEx" class="form-label">Your Role</label>
<select class="form-select" tabindex="0" id="roleEx">
<option>Web Developer</option>
<option>Business Owner</option>
<option>Other</option>
</select>
</div>
</div>
</div>
</form>
</div>
</div>
<div class="carousel-item">
<div class="onboarding-media">
<div class="mx-2">
<img src="assets/img/illustrations/boy-with-laptop-light.png" alt="boy-with-laptop-light" width="300" class="img-fluid">
</div>
</div>
<div class="onboarding-content">
<h4 class="onboarding-title text-body">Example Request Information</h4>
<div class="onboarding-info">In this example you can see a form where you can request some
additional information from the customer when they land on the app page.</div>
<form>
<div class="row">
<div class="col-sm-6">
<div class="mb-3">
<label for="nameEx1" class="form-label">Your Full Name</label>
<input class="form-control" placeholder="Enter your full name..." type="text" value="" tabindex="0" id="nameEx1">
</div>
</div>
<div class="col-sm-6">
<div class="mb-3">
<label for="roleEx1" class="form-label">Your Role</label>
<select class="form-select" tabindex="0" id="roleEx1">
<option>Web Developer</option>
<option>Business Owner</option>
<option>Other</option>
</select>
</div>
</div>
</div>
</form>
</div>
</div>
<div class="carousel-item">
<div class="onboarding-media">
<div class="mx-2">
<img src="assets/img/illustrations/girl-verify-password-light.png" alt="girl-verify-password-light" width="300" class="img-fluid">
</div>
</div>
<div class="onboarding-content">
<h4 class="onboarding-title text-body">Example Request Information</h4>
<div class="onboarding-info">In this example you can see a form where you can request some
additional information from the customer when they land on the app page.</div>
<form>
<div class="row">
<div class="col-sm-6">
<div class="mb-3">
<label for="nameEx2" class="form-label">Your Full Name</label>
<input class="form-control" placeholder="Enter your full name..." type="text" value="" tabindex="0" id="nameEx2">
</div>
</div>
<div class="col-sm-6">
<div class="mb-3">
<label for="roleEx2" class="form-label">Your Role</label>
<select class="form-select" tabindex="0" id="roleEx2">
<option>Web Developer</option>
<option>Business Owner</option>
<option>Other</option>
</select>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
<a class="carousel-control-prev" href="#modalCarouselControls" role="button" data-bs-slide="prev">
<i class="bx bx-chevrons-left lh-1"></i><span>Previous</span>
</a>
<a class="carousel-control-next" href="#modalCarouselControls" role="button" data-bs-slide="next">
<span>Next</span><i class="bx bx-chevrons-right lh-1"></i>
</a>
</div>
</div>
</div>
</div>
<!--/ Vertical slider modal -->
<!-- horizontal slider modal -->
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#onboardingHorizontalSlideModal">Horizontal Slider modal</button>
<div class="modal-onboarding modal fade animate__animated" id="onboardingHorizontalSlideModal" tabindex="-1" aria-hidden="true">
<div class="modal-dialog modal-xl" role="document">
<div class="modal-content text-center">
<div class="modal-header border-0">
<a class="text-muted close-label" href="javascript:void(0);" data-bs-dismiss="modal">Skip Intro</a>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close">
</button>
</div>
<div id="modalHorizontalCarouselControls" class="carousel slide pb-6 mb-2" data-bs-interval="false">
<div class="carousel-indicators">
<button type="button" data-bs-target="#modalHorizontalCarouselControls" data-bs-slide-to="0" class="active"></b>
<button type="button" data-bs-target="#modalHorizontalCarouselControls" data-bs-slide-to="1"></b>
<button type="button" data-bs-target="#modalHorizontalCarouselControls" data-bs-slide-to="2"></b>
</div>
<div class="carousel-inner">
<div class="carousel-item active">
<div class="onboarding-horizontal">
<div class="onboarding-media">
<img src="assets/img/illustrations/boy-with-rocket-light.png" alt="boy-with-rocket-light" width="273" class="img-fluid">
</div>
<div class="onboarding-content">
<h4 class="onboarding-title text-body">Example Request Information</h4>
<div class="onboarding-info">In this example you can see a form where you can request some
additional information from the customer when they land on the app page.</div>
<form>
<div class="row">
<div class="col-sm-6">
<div class="mb-3">
<label for="nameEx4" class="form-label">Your Full Name</label>
<input class="form-control" placeholder="Enter your full name..." type="text" value="" tabindex="0" id="nameEx4">
</div>
</div>
<div class="col-sm-6">
<div class="mb-3">
<label for="roleEx4" class="form-label">Your Role</label>
<select class="form-select" tabindex="0" id="roleEx4">
<option>Web Developer</option>
<option>Business Owner</option>
<option>Other</option>
</select>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
<div class="carousel-item">
<div class="onboarding-horizontal">
<div class="onboarding-media">
<img src="assets/img/illustrations/girl-doing-yoga-light.png" alt="boy-with-rocket-light" width="273" class="img-fluid">
</div>
<div class="onboarding-content">
<h4 class="onboarding-title text-body">Example Request Information</h4>
<div class="onboarding-info">In this example you can see a form where you can request some
additional information from the customer when they land on the app page.</div>
<form>
<div class="row">
<div class="col-sm-6">
<div class="mb-3">
<label for="nameEx5" class="form-label">Your Full Name</label>
<input class="form-control" placeholder="Enter your full name..." type="text" value="" tabindex="0" id="nameEx5">
</div>
</div>
<div class="col-sm-6">
<div class="mb-3">
<label for="roleEx5" class="form-label">Your Role</label>
<select class="form-select" tabindex="0" id="roleEx5">
<option>Web Developer</option>
<option>Business Owner</option>
<option>Other</option>
</select>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
<div class="carousel-item">
<div class="onboarding-horizontal">
<div class="onboarding-media">
<img src="assets/img/illustrations/boy-with-laptop-light.png" alt="boy-with-laptop-light" width="273" class="img-fluid">
</div>
<div class="onboarding-content">
<h4 class="onboarding-title text-body">Example Request Information</h4>
<div class="onboarding-info">In this example you can see a form where you can request some
additional information from the customer when they land on the app page.</div>
<form>
<div class="row">
<div class="col-sm-6">
<div class="mb-3">
<label for="nameEx6" class="form-label">Your Full Name</label>
<input class="form-control" placeholder="Enter your full name..." type="text" value="" tabindex="0" id="nameEx6">
</div>
</div>
<div class="col-sm-6">
<div class="mb-3">
<label for="roleEx6" class="form-label">Your Role</label>
<select class="form-select" tabindex="0" id="roleEx6">
<option>Web Developer</option>
<option>Business Owner</option>
<option>Other</option>
</select>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<a class="carousel-control-prev" href="#modalHorizontalCarouselControls" role="button" data-bs-slide="prev">
<i class="bx bx-chevrons-left lh-1"></i><span>Previous</span>
</a>
<a class="carousel-control-next" href="#modalHorizontalCarouselControls" role="button" data-bs-slide="next">
<span>Next</span><i class="bx bx-chevrons-right lh-1"></i>
</a>
</div>
</div>
</div>
</div>
<!--/ horizontal slider modal -->