updateTabsetPanel

0th

Percentile

Change the selected tab on the client

Change the selected tab on the client

Usage
updateTabsetPanel(session, inputId, selected = NULL)

updateNavbarPage(session, inputId, selected = NULL)

updateNavlistPanel(session, inputId, selected = NULL)

Arguments
session

The session object passed to function given to shinyServer.

inputId

The id of the tabsetPanel, navlistPanel, or navbarPage object.

selected

The name of the tab to make active.

See Also

tabsetPanel(), navlistPanel(), navbarPage()

Aliases
  • updateTabsetPanel
  • updateNavbarPage
  • updateNavlistPanel
Examples
# NOT RUN {
## Only run examples in interactive R sessions
if (interactive()) {

ui <- fluidPage(sidebarLayout(
  sidebarPanel(
    sliderInput("controller", "Controller", 1, 3, 1)
  ),
  mainPanel(
    tabsetPanel(id = "inTabset",
      tabPanel(title = "Panel 1", value = "panel1", "Panel 1 content"),
      tabPanel(title = "Panel 2", value = "panel2", "Panel 2 content"),
      tabPanel(title = "Panel 3", value = "panel3", "Panel 3 content")
    )
  )
))

server <- function(input, output, session) {
  observeEvent(input$controller, {
    updateTabsetPanel(session, "inTabset",
      selected = paste0("panel", input$controller)
    )
  })
}

shinyApp(ui, server)
}
# }
Documentation reproduced from package shiny, version 1.4.0, License: GPL-3 | file LICENSE

Community examples

Looks like there are no examples yet.