% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/glass_tabs.R
\name{updateGlassTabsUI}
\alias{updateGlassTabsUI}
\title{Programmatically switch the active glass tab}
\usage{
updateGlassTabsUI(session, id, selected)
}
\arguments{
\item{session}{Shiny session object.}

\item{id}{Module id matching the \code{id} passed to \code{\link[=glassTabsUI]{glassTabsUI()}}.}

\item{selected}{Value of the tab to activate.}
}
\value{
Called for its side effect; returns \code{NULL} invisibly.
}
\description{
Server-side equivalent of Shiny's \code{updateTabsetPanel()}. Sends a
message to the browser to animate the tab switch just as if the user had
clicked the tab button.
}
\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)
}
}
