Skip to contents

Create a sidebar menu with menu items.

Usage

sidebar_menu(...)

sidebarMenu(...)

Arguments

...

Menu items.

Value

A sidebar menu that can be passed dashboardSidebar

Details

It's possible to set selected menu item by setting `selected = TRUE` in `menuItem`.

Functions

  • sidebarMenu(): Create a sidebar menu (alias for sidebar_menu for compatibility with shinydashboard)

Examples

sidebarMenu(
  menuItem(tabName = "plot_tab", text = "My plot", icon = icon("home")),
  menuItem(tabName = "table_tab", text = "My table", icon = icon("smile"), selected = TRUE)
)
#> <div id="uisidebar">
#>   <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>
#>   <a class="item" href="#shiny-tab-table_tab" data-tab="shiny-tab-table_tab" data-toggle="tab" data-value="table_tab">
#>     <i class="smile icon"></i>
#>     My table
#>     <script>  $(function() {
#>     ['.dashboard-sidebar a', '.tab-content > div'].forEach(function(tag) {
#>       $(`${tag}[data-tab]`).removeClass('active');
#>       $(`${tag}[data-tab="shiny-tab-table_tab"]`).addClass('active');
#>     })
#>   })</script>
#>   </a>
#> </div>