Description Usage Arguments Examples
View source: R/update-functions.R
Programmatically toggle a bs4Card sidebar
Alias to updatebs4CardSidebar See updatebs4CardSidebar for full details
1 2 3  | updatebs4CardSidebar(session, inputId)
updateCardSidebar(session, inputId)
 | 
session | 
 Shiny session object.  | 
inputId | 
 Card sidebar id.  | 
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  | if (interactive()) {
 library(shiny)
 library(bs4Dash)
 
 shinyApp(
  ui = bs4DashPage(
    sidebar_collapsed = FALSE,
    controlbar_collapsed = TRUE,
    enable_preloader = FALSE,
    navbar = bs4DashNavbar(skin = "dark"),
    body = bs4DashBody(
      bs4Card(
        title = "Closable Box with gradient", 
        closable = TRUE, 
        width = 12,
        height = "500px",
        solidHeader = FALSE, 
        collapsible = TRUE,
        actionButton("update", "Toggle card sidebar"),
        sidebar = bs4CardSidebar(
          inputId = "mycardsidebar",
          p("Sidebar Content")
        )
      )
    ),
    sidebar = bs4DashSidebar(),
    controlbar = bs4DashControlbar(),
    footer = bs4DashFooter()
  ),
  server = function(input, output, session) {
    observe(print(input$mycardsidebar))
    
    observeEvent(input$update, {
      updatebs4CardSidebar(session, inputId = "mycardsidebar")
    })
    
  }
 )
}
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.