Home > Blockchain >  How to completely collapse sidebar in bs4Dash
How to completely collapse sidebar in bs4Dash

Time:04-07

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

CodePudding user response:

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

CodePudding user response:

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

enter image description here

  • Related