15
votes

I like the new library(shinydashboards), but I wonder whether it's possible to arrange several tabs next to each other in the dashboard header - like in the navbarpage layout of the normal shiny library?

It seems impossible to use the navbarlaout within a "dashboardPage" since "navbarPage" is a layout command like "dashboardPage".

Nevertheless, a combination of navbarpage & dashboardPage would be interesting.

From the shinydashboard examples I found (below and others), it looks like different dashboard tabs can only be placed in the sidebar.

Has anyone found a way to add tabs for several dashboards in the "dashboardPage" header?

https://github.com/rstudio/shinydashboard/tree/gh-pages/_apps

2

2 Answers

0
votes

Samples here are using the dropdownMenu() function. The type is currently very limited (e.g., can choose icon from libraries font-awesome or glyphicon, but not text), but maybe that is enough customization to make this useful for your application?

0
votes

So I've been adding tabs to my top header by adding them as links within html

  • tags. I appreciate this isn't quite the same thing as having tabs, because the links are hosted on different urls, but in my case that's the whole reason I need the additional tabs and can't just use navbarPage e.g.:
    dashboardPage(
        dashboardHeader(
            title = "Your Page Title",
            tags$li(
                a(
                strong("Tab Title"),
                height = 30, 
                href = "www.google.com"
                title = "",
                target = "_blank"
                ),
             class = "dropdown"
    )))}