I am trying to use the page_fillable
function in Shiny to ensure that my panels fill the remaining page space. However, when I run the example code below, I see that the Data
(green area) and Plot
(blue area) panels do not fill the remaining page space, leaving a large blank area on the right side of the page. How can I fix this issue?
Here is the reproducible example code:
library(shiny)
library(shinyWidgets)
library(bslib)
ui <-
page_sidebar(
titlePanel("A shiny example"),
sidebar = sidebar(
title = 'a sidebar',
id = "sidebar",
),
mainPanel(
tabsetPanel(
tabPanel('Data',
div(style = "background-color: green; padding: 10px;",
page_fillable(
tableOutput('dt')
)
)
),
tabPanel('Plot',
page_fillable(
div(style = "overflow-x: scroll; overflow-y: scroll; background-color: blue;",
plotOutput("pplot"))
)
)
)
)
)
server <- function(input, output, session){
}
shinyApp(ui = ui, server = server)
The resulting Shiny app looks like the screenshot below: