Description Usage Arguments Author(s) Examples
View source: R/dashboardSidebar.R
Build an adminLTE3 dashboard main sidebar menu
1 2 3 4 5 6 7 8 9 |
... |
Slot for bs4SidebarMenuItem or bs4SidebarHeader. |
id |
For bs4SidebarMenu, if |
flat |
Whether sidebar items should have a flat design. FALSE by default. |
compact |
Whether items should be compacted. FALSE by default. |
child_indent |
Whether to indent children. TRUE by default |
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 | if (interactive()) {
library(shiny)
library(bs4Dash)
shinyApp(
ui = bs4DashPage(
sidebar_collapsed = TRUE,
controlbar_collapsed = TRUE,
enable_preloader = FALSE,
loading_duration = 2,
navbar = bs4DashNavbar(skin = "light"),
body = bs4DashBody(
),
sidebar = bs4DashSidebar(
skin = "light",
bs4SidebarMenu(
id = "test",
bs4SidebarMenuItem(
tabName = "tab1",
text = "Tab 1"
),
bs4SidebarMenuItem(
tabName = "tab2",
text = "Tab 2"
),
bs4SidebarMenuItem(
text = "Click me pleaaaaase",
bs4SidebarMenuSubItem(
tabName = "subtab1",
text = "Tab 3"
),bs4SidebarMenuSubItem(
tabName = "subtab2",
text = "Tab 4"
)
)
)
),
controlbar = bs4DashControlbar(skin = "light"),
footer = bs4DashFooter()
),
server = function(input, output, session) {
observeEvent(input$test, {
if (input$test == "subtab1") {
showModal(modalDialog(
title = "Thank you so much",
"You clicked me! This event is the result of
an input bound to the menu. By adding an id to the
bs4SidebarMenu, input$id will give the currently selected
tab. This is useful to trigger some events.",
easyClose = TRUE,
footer = NULL
))
}
})
}
)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.