How to add more Whitespace to the Main Panel in Shiny Dashboard?

15,884

Solution 1

Use CSS, in your ui.R file add:

tags$head(
   tags$style(
       HTML("#dashboard{margin-bottom:50px;}")
   )
)

Solution 2

Can you try to wrap you showOutput with a div wrap?

tags$div(
  style="margin-bottom:50px;",
  showOutput("plot4", "Nvd3")
)

Solution 3

I had the same problem. Putting everything in a fluidRow() fixed it for me...

Solution 4

For vertical whitespace in Shiny, you can go with headerPanel("")

Solution 5

I had the same problem and according to tip Jthorpe I removed all mainPanelfrom my script. I have six plots one by one verticaly and it works fine.

Share:
15,884
Gary
Author by

Gary

Updated on July 24, 2022

Comments

  • Gary
    Gary almost 2 years

    I have a couple of charts in my Main Panel in my Shiny Dashboard, and I was wondering how to extend the whitespace at the bottom of the main panel? How should I modify my ui.R to do this?

    enter image description here

    dashboardBody(
        tabItems(
          tabItem("dashboard",
    
                  mainPanel(
                    showOutput("plot3", "Nvd3"),
                    showOutput("plot4", "Nvd3")
    
             )),
    

    Update: Adding HTML("<br><br><br>") in the Main Panel only created a wider dark panel: enter image description here

  • BlackHat
    BlackHat over 7 years
    What about adding whitespace between the two charts?