[modal] option to set a width
See original GitHub issueThis is an enhancement request.
There is size
option (i.e. sm
, md
) for the modal component, but it would be great if there is an option to set the exact width / max-width. For example, <b-modal :width=400></b-modal>
so that the modal width would not be no more than 400px.
Thank you.
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
How to increase Bootstrap Modal Width? - Stack Overflow
You can choose between modal-lg and modal-xl classes or if you want custom width then, set max-width property with inline css. For example,...
Read more >How to Change the Default Width of Bootstrap Modal Box
Answer: Set width for .modal-dialog element ... By default, Bootstrap modal are available in four different sizes — small, default, large and extra-large....
Read more >How to change Bootstrap Modal Width and Height - 3 Examples
In order to increase or decrease the modal window height and width properties of Bootstrap, you need to get the modal related classes...
Read more >How to configure modal width in Bootstrap? - GeeksforGeeks
In this article, we will focus on adjusting the width/height of the modal box. Method 1: Using pre-defined Bootstrap classes
Read more >Modal - Bootstrap
Use Bootstrap's JavaScript modal plugin to add dialogs to your site for lightboxes, user notifications, or completely custom content.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Bootstrap-vue tries to follow the Bootstrap V4 standard CSS, and hence we only offer the standard Bootstrap modal sizes.
You can, however, place a class on
<b-modal>
, which will get applied to modal’s root element (div.modal
), and then target the.modal-dialog
to set the widthHTML:
CSS:
This technique will also allow you to set the width based on media queries as well, so it will fit on mobile devices.
@Ota-kun , @vacolane
Create a new modal-[size] class like
modal-huge
, and then create custom CSS to set width (note Bootstrap V4 uses max-width on all modal sizes, so you need to set max-width, and based on media queries, so you may need to target a certain screen width)and use that size on b-modal:
The
size
prop just adds a class on the modal-dialog elementmodal-xxx
wherexxx
is the text passed to thesize
prop (i.e.huge
is converted tomodal-huge
). So modal isn’t limiting you to specific sizes, it is only limited by what CSS classes exist.