How to completely collapse sidebar in bs4Dash

453 views Asked by At

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

2

There are 2 answers

0
Farhad On BEST ANSWER

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) {}
)

0
Farhad On

Here is a sample picture which shows that the sidebar is completely collapsed.

enter image description here