Making Bootstrap modals wider

Bootstrap modals come in 4 sizes, You have the default, small, large and extra-large. The default size is closer to small and often at times in usage feels very restricted in its width. Considering the whole page can be used for content yet the modal pops up and uses less than 25% of the width.

bootstrap wider modalsThis minimal sized, pop up content feels natural to be smaller than the page. That’s the distraction however occasionally more than some words and buttons need to be in a modal.

4 sizes

The small modal has a max-width of 300px, default is 500px, large is 800px and extra-large has a max-width of 1140px.

Using the default Bootstrap classes to achieve a wider modal rather than just setting the max-width in CSS means that it will be responsive at different frame sizes.

Usage

Use modal-lg beside modal-dialog for a wider modal, modal-xl for a really wide modal or modal-sm for a smaller modal.

Example:

<div class="modal-dialog modal-lg">

Or a working example at CodePen.