Can a shinydashboard use Tabpanels and have a navigation bar?

I am currently using shinydashboard, but I would like to have different sidbar menus related to the content in the main body. Is this possible with shinydashboard?

For instance:

I would like to have something like this https://gallery.shinyapps.io/CDCPlot/

See how clicking on the navigation bar options changes the sidebar menu as well as the body.

Is this possible in shinydashboad? I like the look of shinydashboard and it's better not to go back to shiny.

Below is the code below: https://github.com/NLMichaud/WeeklyCDCPlot/blob/master/ui.R

and uses tabpanels and navbar. Is there something similar in shinydashboard?

Any code examples?

Thank!

+1
source share
1 answer

What you are asking is complicated, and it may be impossible, because in a shinydashboard, top-level controls are located inside the dashboard (left), and the content is contained inside the control panel (right). If you place navMenu inside the Body toolbar, it must belong to a specific sidebar item and disappear if you later click on another sidebar item.

You may need to change the way you want to achieve this. Depending on what you want to do, you may try:

, , tabItem. , renderMenu() server.R:

output$menu <- renderMenu({
   sidebarMenu(id = "sidebMenu",
       menuItem("Load Data", tabName = "loadData", icon = icon("database"),
          actionButton("press", "Press me")
   )
})

, , , , , , - . , .

dashboardSidebar(disable = TRUE) , . shinydashboard, , . , , shinydashboard, , , , .. , .

, .

+1

Source: https://habr.com/ru/post/1685418/


All Articles