Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Customize the size of a modal window in ShinyBS

Tags:

shiny

shinybs

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?

like image 611
tumultous_rooster Avatar asked Oct 07 '15 04:10

tumultous_rooster


1 Answers

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
)
like image 181
Romain Avatar answered Jan 04 '23 05:01

Romain