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-outline-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="#modalCenter">
Launch modal
</button>
<!-- Modal -->
<div class="modal fade" id="modalCenter" tabindex="-1" 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="modalCenterTitle">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 mt-2">
<div class="form-floating form-floating-outline">
<input type="text" id="nameWithTitle" class="form-control" placeholder="Enter Name">
<label for="nameWithTitle">Name</label>
</div>
</div>
</div>
<div class="row g-4">
<div class="col mb-2">
<div class="form-floating form-floating-outline">
<input type="email" id="emailWithTitle" class="form-control" placeholder="xxxx@xxx.xx">
<label for="emailWithTitle">Email</label>
</div>
</div>
<div class="col mb-2">
<div class="form-floating form-floating-outline">
<input type="date" id="dobWithTitle" class="form-control">
<label for="dobWithTitle">DOB</label>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-outline-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-outline-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-outline-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 mt-2">
<div class="form-floating form-floating-outline">
<input type="text" id="nameBackdrop" class="form-control" placeholder="Enter Name">
<label for="nameBackdrop">Name</label>
</div>
</div>
</div>
<div class="row g-4">
<div class="col mb-2">
<div class="form-floating form-floating-outline">
<input type="email" id="emailBackdrop" class="form-control" placeholder="xxxx@xxx.xx">
<label for="emailBackdrop">Email</label>
</div>
</div>
<div class="col mb-2">
<div class="form-floating form-floating-outline">
<input type="date" id="dobBackdrop" class="form-control">
<label for="dobBackdrop">DOB</label>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-outline-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-outline-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 mt-2">
<div class="form-floating form-floating-outline">
<input type="text" id="nameSmall" class="form-control" placeholder="Enter Name">
<label for="nameSmall">Name</label>
</div>
</div>
</div>
<div class="row g-4">
<div class="col mb-2">
<div class="form-floating form-floating-outline">
<input type="email" class="form-control" id="emailSmall" placeholder="xxxx@xxx.xx">
<label for="emailSmall">Email</label>
</div>
</div>
<div class="col mb-2">
<div class="form-floating form-floating-outline">
<input id="dobSmall" type="date" class="form-control">
<label for="dobSmall">DOB</label>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-outline-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 mt-2">
<div class="form-floating form-floating-outline">
<input type="text" id="nameBasic" class="form-control" placeholder="Enter Name">
<label for="nameBasic">Name</label>
</div>
</div>
</div>
<div class="row g-4">
<div class="col mb-2">
<div class="form-floating form-floating-outline">
<input type="email" id="emailBasic" class="form-control" placeholder="xxxx@xxx.xx">
<label for="emailBasic">Email</label>
</div>
</div>
<div class="col mb-2">
<div class="form-floating form-floating-outline">
<input type="date" id="dobBasic" class="form-control">
<label for="dobBasic">DOB</label>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-outline-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 mt-2">
<div class="form-floating form-floating-outline">
<input type="text" id="nameLarge" class="form-control" placeholder="Enter Name">
<label for="nameLarge">Name</label>
</div>
</div>
</div>
<div class="row g-4">
<div class="col mb-2">
<div class="form-floating form-floating-outline">
<input type="email" id="emailLarge" class="form-control" placeholder="xxxx@xxx.xx">
<label for="emailLarge">Email</label>
</div>
</div>
<div class="col mb-2">
<div class="form-floating form-floating-outline">
<input type="date" id="dobLarge" class="form-control">
<label for="dobLarge">DOB</label>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-outline-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 mt-2">
<div class="form-floating form-floating-outline">
<input type="text" id="nameExLarge" class="form-control" placeholder="Enter Name">
<label for="nameExLarge">Name</label>
</div>
</div>
</div>
<div class="row g-4">
<div class="col mb-2">
<div class="form-floating form-floating-outline">
<input type="email" id="emailExLarge" class="form-control" placeholder="xxxx@xxx.xx">
<label for="emailExLarge">Email</label>
</div>
</div>
<div class="col mb-2">
<div class="form-floating form-floating-outline">
<input type="date" id="dobExLarge" class="form-control">
<label for="dobExLarge">DOB</label>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-outline-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">
<div class="form-floating form-floating-outline">
<input type="text" id="nameSwing" class="form-control" placeholder="Enter Name">
<label for="nameSwing">Name</label>
</div>
</div>
</div>
<div class="row">
<div class="mb-3 col mb-0">
<div class="form-floating form-floating-outline">
<input type="email" id="emailSwing" class="form-control" placeholder="xxxx@xxx.xx">
<label for="emailSwing">Email</label>
</div>
</div>
<div class="mb-3 col mb-0">
<div class="form-floating form-floating-outline">
<input type="date" id="dobSwing" class="form-control">
<label for="dobSwing">DOB</label>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-outline-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-4 col">
<div class="form-floating form-floating-outline">
<input type="text" id="nameFlipInX" class="form-control" placeholder="Enter Name">
<label for="nameFlipInX">Name</label>
</div>
</div>
</div>
<div class="row">
<div class="mb-4 col mb-0">
<div class="form-floating form-floating-outline">
<input type="email" id="emailFlipInX" class="form-control" placeholder="xxxx@xxx.xx">
<label for="emailFlipInX">Email</label>
</div>
</div>
<div class="mb-4 col mb-0">
<div class="form-floating form-floating-outline">
<input type="date" id="dobFlipInX" class="form-control">
<label for="dobFlipInX">DOB</label>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-outline-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.
<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 mt-2">
<div class="form-floating form-floating-outline">
<input type="text" id="nameSlideTop" class="form-control" placeholder="Enter Name">
<label for="nameSlideTop">Name</label>
</div>
</div>
</div>
<div class="row g-4">
<div class="col mb-2">
<div class="form-floating form-floating-outline">
<input type="email" id="emailSlideTop" class="form-control" placeholder="xxxx@xxx.xx">
<label for="emailSlideTop">Email</label>
</div>
</div>
<div class="col mb-2">
<div class="form-floating form-floating-outline">
<input type="date" id="dobSlideTop" class="form-control">
<label for="dobSlideTop">DOB</label>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-outline-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="form-floating form-floating-outline mb-4">
<input class="form-control" placeholder="Enter your full name..." type="text" value="" tabindex="0" id="nameEx">
<label for="nameEx">Your Full Name</label>
</div>
</div>
<div class="col-sm-6">
<div class="form-floating form-floating-outline mb-4">
<select class="form-select" tabindex="0" id="roleEx">
<option>Web Developer</option>
<option>Business Owner</option>
<option>Other</option>
</select>
<label for="roleEx">Your Role</label>
</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="form-floating form-floating-outline mb-4">
<input class="form-control" placeholder="Enter your full name..." type="text" value="" tabindex="0" id="nameEx1">
<label for="nameEx1">Your Full Name</label>
</div>
</div>
<div class="col-sm-6">
<div class="form-floating form-floating-outline mb-4">
<select class="form-select" tabindex="0" id="roleEx1">
<option>Web Developer</option>
<option>Business Owner</option>
<option>Other</option>
</select>
<label for="roleEx1">Your Role</label>
</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="form-floating form-floating-outline mb-4">
<input class="form-control" placeholder="Enter your full name..." type="text" value="" tabindex="0" id="nameEx2">
<label for="nameEx2">Your Full Name</label>
</div>
</div>
<div class="col-sm-6">
<div class="form-floating form-floating-outline mb-4">
<select class="form-select" tabindex="0" id="roleEx2">
<option>Web Developer</option>
<option>Business Owner</option>
<option>Other</option>
</select>
<label for="roleEx2">Your Role</label>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
<a class="carousel-control-prev" href="#modalCarouselControls" role="button" data-bs-slide="prev">
<i class="ri-arrow-left-double-line me-1 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="ri-arrow-right-double-line ms-1 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"></button>
<button type="button" data-bs-target="#modalHorizontalCarouselControls" data-bs-slide-to="1"></button>
<button type="button" data-bs-target="#modalHorizontalCarouselControls" data-bs-slide-to="2"></button>
</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="form-floating form-floating-outline mb-4">
<input class="form-control" placeholder="Enter your full name..." type="text" value="" tabindex="0" id="nameEx4">
<label for="nameEx4">Your Full Name</label>
</div>
</div>
<div class="col-sm-6">
<div class="form-floating form-floating-outline mb-4">
<select class="form-select" tabindex="0" id="roleEx4">
<option>Web Developer</option>
<option>Business Owner</option>
<option>Other</option>
</select>
<label for="roleEx4">Your Role</label>
</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="form-floating form-floating-outline mb-4">
<input class="form-control" placeholder="Enter your full name..." type="text" value="" tabindex="0" id="nameEx5">
<label for="nameEx5">Your Full Name</label>
</div>
</div>
<div class="col-sm-6">
<div class="form-floating form-floating-outline mb-4">
<select class="form-select" tabindex="0" id="roleEx5">
<option>Web Developer</option>
<option>Business Owner</option>
<option>Other</option>
</select>
<label for="roleEx5">Your Role</label>
</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="form-floating form-floating-outline mb-4">
<input class="form-control" placeholder="Enter your full name..." type="text" value="" tabindex="0" id="nameEx6">
<label for="nameEx6">Your Full Name</label>
</div>
</div>
<div class="col-sm-6">
<div class="form-floating form-floating-outline mb-4">
<select class="form-select" tabindex="0" id="roleEx6">
<option>Web Developer</option>
<option>Business Owner</option>
<option>Other</option>
</select>
<label for="roleEx6">Your Role</label>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<a class="carousel-control-prev" href="#modalHorizontalCarouselControls" role="button" data-bs-slide="prev">
<i class="ri-arrow-left-double-line me-1 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="ri-arrow-right-double-line ms-1 lh-1"></i>
</a>
</div>
</div>
</div>
</div>
<!--/ horizontal slider modal -->