R/dashboardControlbar.R
, R/aliases.R
dashboardControlbar.Rd
Build an adminLTE3 dashboard right sidebar
bs4DashControlbar(
...,
id = NULL,
disable = FALSE,
width = 250,
collapsed = TRUE,
overlay = TRUE,
skin = NULL,
pinned = NULL
)
controlbarMenu(
...,
id = NULL,
selected = NULL,
type = c("tabs", "pills", "hidden"),
vertical = FALSE,
side = "left",
.list = NULL
)
controlbarItem(title, ..., value = title, icon = NULL)
updateControlbarMenu(
session = shiny::getDefaultReactiveDomain(),
inputId,
selected = NULL
)
updateControlbar(id, session = shiny::getDefaultReactiveDomain())
dashboardControlbar(
...,
id = NULL,
disable = FALSE,
width = 250,
collapsed = TRUE,
overlay = TRUE,
skin = NULL,
pinned = NULL
)
Any UI element.
Controlbar id.
If TRUE
, the sidebar will be disabled.
Controlbar width. This must either be a number which specifies the width in pixels, or a string that specifies the width in CSS units. 250 px by default.
Whether the control bar on the right side is collapsed or not at start. TRUE by default.
Whether the sidebar covers the content when expanded. Default to TRUE.
Controlbar skin. "dark" or "light". Matches the dashboardPage dark parameter value.
Whether to block the controlbar state (TRUE or FALSE). Default to NULL.
The value
(or, if none was supplied, the title
)
of the tab that should be selected by default. If NULL
, the first
tab will be selected.
Standard tab look
Selected tabs use the background fill color
Whether to displays tabs vertically. Default to FALSE.
Tabs side: "left" or "right"
.
In case of programmatically generated items. See example.
Display title for tab
The value that should be sent when tabsetPanel
reports
that this tab is selected. If omitted and tabsetPanel
has an
id
, then the title will be used.
Optional icon to appear on the tab. This attribute is only
valid when using a tabPanel
within a navbarPage()
.
Shiny session object.
The id of the tabsetPanel
, navlistPanel
,
or navbarPage
object.
if (interactive()) {
library(shiny)
library(bs4Dash)
shinyApp(
ui = dashboardPage(
header = dashboardHeader(),
sidebar = dashboardSidebar(),
body = dashboardBody(
actionButton(inputId = "controlbarToggle", label = "Toggle Controlbar")
),
controlbar = dashboardControlbar(
id = "controlbar",
collapsed = FALSE,
overlay = TRUE
),
title = "updateControlbar"
),
server = function(input, output, session) {
observeEvent(input$controlbar, {
if (input$controlbar) {
showModal(modalDialog(
title = "Alert",
"The controlbar is opened.",
easyClose = TRUE,
footer = NULL
))
}
})
observeEvent(input$controlbarToggle, {
updateControlbar(id = "controlbar", session = session)
})
observe({
print(input$controlbar)
})
}
)
}