Description Usage Arguments Author(s) Examples
View source: R/dashboardSidebar.R
Build an adminLTE3 dashboard main sidebar menu sub-item
| 1 2 3 | bs4SidebarMenuSubItem(text, tabName = NULL, icon = NULL, selected = NULL)
menuSubItem(text, tabName = NULL, icon = NULL, selected = NULL)
 | 
| text | Item name. | 
| tabName | Should correspond exactly to the tabName given in  | 
| icon | Item icon. | 
| selected | If  | 
David Granjon, dgranjon@ymail.com
| 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 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | if (interactive()) {
 library(shiny)
 library(bs4Dash)
 
 shiny::shinyApp(
   ui = bs4DashPage(
     navbar = bs4DashNavbar(),
     sidebar = bs4DashSidebar(
       bs4SidebarMenu(
         bs4SidebarHeader("List of items 1"),
         bs4SidebarMenuItem(
           text = "Item List",
           icon = "bars",
           startExpanded = TRUE,
           bs4SidebarMenuSubItem(
             text = "Item 1",
             tabName = "item1",
             icon = "circle-thin"
           ),
           bs4SidebarMenuSubItem(
             text = "Item 2",
             tabName = "item2",
             icon = "circle-thin"
           )
         ),
         bs4SidebarHeader("Classic Items"),
         bs4SidebarMenuItem(
           text = "Item 3",
           tabName = "item3"
         ),
         bs4SidebarHeader("List of items 2"),
         bs4SidebarMenuItem(
           text = "Item List 2",
           icon = "bars",
           startExpanded = FALSE,
           #active = FALSE,
           bs4SidebarMenuSubItem(
             text = "Item 4",
             tabName = "item4",
             icon = "circle-thin"
           ),
           bs4SidebarMenuSubItem(
             text = "Item 5",
             tabName = "item5",
             icon = "circle-thin",
             selected = TRUE
           )
         )
       )
     ),
     controlbar = bs4DashControlbar(),
     footer = bs4DashFooter(),
     title = "test",
     body = bs4DashBody(
       bs4TabItems(
         bs4TabItem(
           tabName = "item1",
           bs4Card(
             title = "Card 1", 
             closable = TRUE, 
             width = 6,
             solidHeader = TRUE, 
             status = "primary",
             collapsible = TRUE,
             p("Box Content")
           )
         ),
         bs4TabItem(
           tabName = "item2",
           bs4Card(
             title = "Card 2", 
             closable = TRUE, 
             width = 6,
             solidHeader = TRUE, 
             status = "warning",
             collapsible = TRUE,
             p("Box Content")
           )
         ),
         bs4TabItem(
           tabName = "item3",
           bs4Card(
             title = "Card 3", 
             closable = TRUE, 
             width = 6,
             solidHeader = TRUE, 
             status = "danger",
             collapsible = TRUE,
             p("Box Content")
           )
         ),
         bs4TabItem(
           tabName = "item4",
           bs4Card(
             title = "Card 4", 
             closable = TRUE, 
             width = 6,
             solidHeader = TRUE, 
             status = "info",
             collapsible = TRUE,
             p("Box Content")
           )
         ),
         bs4TabItem(
           tabName = "item5",
           bs4Card(
             title = "Card 5", 
             closable = TRUE, 
             width = 6,
             solidHeader = TRUE, 
             status = "success",
             collapsible = TRUE,
             p("Box Content")
           )
         )
       )
     )
   ),
   server = function(input, output) {}
 )
}
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.