Function to programmatically toggle the state of the controlbar

updateControlbar(id, session = shiny::getDefaultReactiveDomain())

Arguments

id

Controlbar id.

session

Shiny session object.

Examples

if (interactive()) { library(shiny) library(shinydashboard) library(shinydashboardPlus) shinyApp( ui = dashboardPage( header = dashboardHeader(), sidebar = dashboardSidebar(), body = dashboardBody( actionButton(inputId = "controlbarToggle", label = "Toggle Controlbar") ), controlbar = dashboardControlbar(id = "controlbar") ), 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("controlbar") }) observe({ print(input$controlbar) }) } ) }