javascriptrshinysidebarbs4dash

How to completely collapse sidebar in bs4Dash


I need to fully (not partially) collapse the main sidebar (left) in my app with toggle button. I noticed there is an argument: sidebar_fullCollapse in shinydashboardPlus, that if set to TRUE will collapse the sidebar completely. However, we do not have this parameter in bs4DashPage. Any help would be highly appreciated.

library(shiny)
library(bs4Dash)

shinyApp(
  ui = bs4DashPage(
    header = dashboardHeader(),
    body = dashboardBody(),
    sidebar = dashboardSidebar()
  ),
  server = function(input, output, session) {}
)

enter image description here


Solution

  • I just found the answer to this question. There is a parameter in bs4DashPage by the name of minified. Setting this parameter to FALSE will collapse the sidebar completely.

    library(shiny)
    library(bs4Dash)
    
    shinyApp(
      ui = bs4DashPage(
        header = dashboardHeader(),
        body = dashboardBody(),
        sidebar = dashboardSidebar(
          minified = F
        )
      ),
      server = function(input, output, session) {}
    )