updateTabsetPanel {shiny}R Documentation

Change the selected tab on the client

Description

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

Examples

## Not run: 
shinyServer(function(input, output, session) {

  observe({
    # TRUE if input$controller is even, FALSE otherwise.
    x_even <- input$controller %% 2 == 0

    # Change the selected tab.
    # Note that the tabset container must have been created with an 'id' argument
    if (x_even) {
      updateTabsetPanel(session, "inTabset", selected = "panel2")
    } else {
      updateTabsetPanel(session, "inTabset", selected = "panel1")
    }
  })
})

## End(Not run)

[Package shiny version 0.13.2 Index]