Skip to contents

Tracks the active tab and exposes it as a reactive value.

Usage

glassTabsServer(id)

Arguments

id

Module id matching the id passed to glassTabsUI().

Value

A reactive expression returning the active tab value.

Examples

if (interactive()) {
  library(shiny)
  ui <- fluidPage(
    useGlassTabs(),
    glassTabsUI(
      "tabs",
      glassTabPanel("a", "A", p("Tab A"), selected = TRUE),
      glassTabPanel("b", "B", p("Tab B"))
    )
  )
  server <- function(input, output, session) {
    active <- glassTabsServer("tabs")
    observe(print(active()))
  }
  shinyApp(ui, server)
}