RinteRface / shinydashboardPlus

extensions for shinydashboard
https://shinydashboardplus.rinterface.com
Other
455 stars 77 forks source link

dashboard sidebar collapsed = TRUE state not working #17

Closed arihanth-jain closed 5 years ago

arihanth-jain commented 6 years ago

Hi, setting dashboardSidebar with collapsed to TRUE is not working. The app still starts in default uncollapsed state.

Thanks.

DivadNojnarg commented 5 years ago

You need:

library(shiny)
library(shinydashboard)
library(shinydashboardPlus)

shinyApp(
  ui = dashboardPagePlus(
    collapse_sidebar = TRUE,
    dashboardHeaderPlus(
      enable_rightsidebar = TRUE,
      rightSidebarIcon = "gears"
    ),
    dashboardSidebar(collapsed = TRUE),
    dashboardBody(),
    rightsidebar = rightSidebar()
  ),
  server = function(input, output) {}
)

Especially the collapse_sidebar = TRUE argument in dashboardPagePlus(). By the way, you are right that I should remove the collapse argument from dashboardSidebar (comes from shinydashboard). This is a useless overlapping 👍

arihanth-jain commented 5 years ago

Sorry for my late response and thanks for your input. It works !