Hide sidebar in default in shinydashboard

后端 未结 2 388
太阳男子
太阳男子 2021-01-02 01:28

I used shinydashboard to create my app. I would like to hide the sidedar in default on desktop environment (e.g. windows), but not to disable it. On the mobile

2条回答
  •  不思量自难忘°
    2021-01-02 01:54

    if you do a ?dashboardSidebar you probably see the usage, like this

    dashboardSidebar(..., disable = FALSE, width = NULL, collapsed = FALSE)

    So this should work

    sidebar <- dashboardSidebar(
      collapsed = TRUE,
      sidebarMenu()
    )
    

    i'm not sure if this depends on your shinydashboard version but you could check/change that as well.

提交回复
热议问题