Skip to contents

Create a menu item corresponding to a tab.

Usage

menu_item(
  text,
  ...,
  icon = NULL,
  tabName = NULL,
  href = NULL,
  newtab = TRUE,
  selected = FALSE
)

menuItem(
  text,
  ...,
  icon = NULL,
  tabName = NULL,
  href = NULL,
  newtab = TRUE,
  selected = FALSE
)

menuSubItem(
  text,
  ...,
  icon = NULL,
  tabName = NULL,
  href = NULL,
  newtab = TRUE,
  selected = FALSE
)

Arguments

text

Text to show for the menu item.

...

This may consist of menuSubItems.

icon

Icon of the menu item. (Optional)

tabName

Id of the tab. Not compatible with href.

href

A link address. Not compatible with tabName.

newtab

If href is supplied, should the link open in a new browser tab?

selected

If TRUE, this menuItem will start selected.

Value

A menu item that can be passed sidebarMenu

Functions

  • menuItem(): Create a menu item (alias for menu_item for compatibility with shinydashboard)

  • menuSubItem(): Create a menu item (alias for menu_item for compatibility with shinydashboard)

Examples

menuItem(tabName = "plot_tab", text = "My plot", icon = icon("home"))
#> <a class="item" href="#shiny-tab-plot_tab" data-tab="shiny-tab-plot_tab" data-toggle="tab" data-value="plot_tab">
#>   <i class="home icon"></i>
#>   My plot
#> </a>