rstudio / bslib

Tools for theming Shiny and R Markdown via Bootstrap 3, 4, or 5.
https://rstudio.github.io/bslib/
Other
443 stars 49 forks source link

When the card is in sidebar, the full screen feature should appear on the entire screen. #1078

Open kaipingyang opened 2 weeks ago

kaipingyang commented 2 weeks ago

Hi teams, I have a suggestion as follows: When the card is in a sidebar, the full screen feature should be displayed on the entire screen instead of full screen in the sidebar.

The test code is as follows:

library(shiny)
library(bslib)
library(ggplot2)

ui <- page_sidebar(
  title = "Example dashboard",
  sidebar = sidebar(
    varSelectInput("var", "Select variable", mtcars),
    card(
      full_screen = TRUE,
      card_header("table"),
      dataTableOutput("table")
    )
  ),
  card(
    full_screen = TRUE,
    card_header("My plot"),
    plotOutput("p")
  )

)

server <- function(input, output) {
  output$table <- renderDataTable({
    mtcars
  })
  output$p <- renderPlot({
    ggplot(mtcars) + geom_histogram(aes(!!input$var))
  })
}

shinyApp(ui, server)

We can see that when we click the full screen button when the card is in the sidebar, the card just goes full screen in the sidebar, which is not what we expected. image

In the main panel, the full screen feature of the card is the desired effect. image

### Tasks