Create a sidebar menu with menu items.
Value
A sidebar menu that can be passed dashboardSidebar
Functions
sidebarMenu()
: Create a sidebar menu (alias forsidebar_menu
for compatibility withshinydashboard
)
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>