Server-side equivalent of Shiny's updateTabsetPanel(). Sends a
message to the browser to animate the tab switch just as if the user had
clicked the tab button.
Arguments
- session
Shiny session object.
- id
Module id matching the
idpassed toglassTabsUI().- selected
Value of the tab to activate.
Examples
if (interactive()) {
library(shiny)
ui <- fluidPage(
useGlassTabs(),
glassTabsUI(
"tabs",
glassTabPanel("a", "A", p("Tab A"), selected = TRUE),
glassTabPanel("b", "B", p("Tab B"))
),
actionButton("go", "Go to B")
)
server <- function(input, output, session) {
observeEvent(input$go, {
updateGlassTabsUI(session, "tabs", selected = "b")
})
}
shinyApp(ui, server)
}