6

I recently used shinyBS to create a modal window, as in

bsModal(id, title, trigger, ..., size)

The size argument is either 'small' or 'large' (or absent).

As you can see, even the large window is pretty small and things get packed in pretty tightly:

enter image description here

Is there any possible hack anyone out there has found that can help to customize the size of the window?

tumultous_rooster
  • 12,150
  • 32
  • 92
  • 149

1 Answers1

11

I know this topice is old but since I found a solution I post it for the person going here to find an answer. You can do it by changing the CSS style. At the begging of your app just precise :

.modal-lg {
width: 4000px;
}

or

.modal-lg {
width: 95%;
}

To change the size of the size = "large"argument in the modal or

.modal-sm {
width: 40px;
}

to change for the small one. Of course change the px to change the size as you want to.

In your application, put the code here to have it available for your app:

dashboardBody(
  tags$head(tags$style(HTML('

                        .modal-lg {
                        width: 4000px;

                        }
                      '))),
#ALL YOUR APP GOES HERE
)
Romain
  • 440
  • 4
  • 17
  • How can I change the height of modal to occupy 90% of screen size? – Bogaso Sep 03 '19 at 11:30
  • you can use next line in your code tags$style(type = 'text/css',".modal-dialog{ max-width: 1500px !important; width: 1500px !important; }") and you can play a little with the px number to have the 90% of your screen, in my case s 1500, but sometimes 1200 is enough – Carlos Tellez May 13 '21 at 21:34