menu_item: Create a menu item.

Description Usage Arguments Value Functions Examples

View source: R/menu_item.R

Description

Create a menu item corresponding to a tab.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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

Examples

1
menuItem(tabName = "plot_tab", text = "My plot", icon = icon("home"))

Example output

Attaching package:semantic.dashboardThe following object is masked frompackage:graphics:

    box

<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>

semantic.dashboard documentation built on Nov. 10, 2021, 1:06 a.m.