Description Usage Arguments Note Author(s) Examples
View source: R/dashboardSidebar.R
Build an adminLTE3 dashboard main sidebar menu item
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | bs4SidebarMenuItem(
text,
...,
tabName = NULL,
icon = NULL,
expandedName = as.character(gsub("[[:space:]]", "", text)),
startExpanded = FALSE,
condition = NULL,
selected = NULL
)
menuItem(
text,
...,
tabName = NULL,
icon = NULL,
expandedName = as.character(gsub("[[:space:]]", "", text)),
startExpanded = FALSE,
condition = NULL,
selected = NULL
)
|
text |
Item name. |
... |
bs4SidebarMenuSubItem. |
tabName |
Should correspond exactly to the tabName given in |
icon |
Item icon. |
expandedName |
A unique name given to each |
startExpanded |
Whether to expand the bs4SidebarMenuItem at start. |
condition |
When using bs4SidebarMenuItem with conditionalPanel, write the condition here (see https://github.com/RinteRface/bs4Dash/issues/35). |
selected |
If |
See examples for a use case of the condition parameter.
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 | if (interactive()) {
# sidebarItem with conditional value
library(shiny)
library(bs4Dash)
ui <- bs4DashPage(
bs4DashNavbar(),
bs4DashSidebar(
bs4SidebarMenu(
id = "sidebarMenu",
bs4SidebarMenuItem(
text = "Tab 1",
tabName = "tab1"
),
bs4SidebarMenuItem(
condition = "input.show == true",
text = "Tab 2",
tabName = "tab2"
)
)
),
bs4DashBody(
bs4TabItems(
bs4TabItem(
tabName = "tab1",
h1("Welcome!"),
checkboxInput("show", "Show Tab 2", FALSE)
),
bs4TabItem(
tabName = "tab2",
h1("Hey! You found me!")
)
)
)
)
server <- function(input, output){}
shinyApp(ui = ui, server = server)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.