Here is a small (silly) code of a shiny dashboard application:
library(shiny)
library(shinydashboard)
ui <- dashboardPage(
dashboardHeader(),
dashboardSidebar(uiOutput("choices")),
dashboardBody()
)
server <- function(input,output) {
output$choices <- renderUI(radioButtons("blabla", NULL, 1:100))
}
shinyApp(ui = ui, server = server)
When you run this code, you see that if you scroll down, the nice background on the right hand side suddenly switches to black. How do I make sure that the background stays nice and uniform throughout the entire page, even if a scroll down and use ui-elements?
I know this is an old question, but I'm adding here for posterity. I did not find a fixed height to be satisfactory as it adds a permanent scrollbar.
Using .content-wrapper { overflow: auto; }
seems to work as I expect. I.e.:
dashboardPage(
dashboardHeader(),
dashboardSidebar(
# ...
),
dashboardBody(
# ...
tags$head(tags$style(HTML('.content-wrapper { overflow: auto; }')))
)
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With