if (FALSE) { # rlang::is_interactive()
library(shiny)
library(bslib)
ui <- page_fluid(
actionButton("show", "Show"),
actionButton("hide", "Hide")
)
server <- function(input, output, session) {
# Defined and revealed entirely from the server
observeEvent(input$show, {
show_offcanvas(
offcanvas("Revealed from the server.", title = "Notice", id = "note")
)
})
observeEvent(input$hide, hide_offcanvas("note"))
}
shinyApp(ui, server)
}
Run the code above in your browser using DataLab