Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

update_tabset

Change the selected tab of a tabset on the client


Description

Change the selected tab of a tabset on the client

Usage

update_tabset(session, input_id, selected = NULL)

Arguments

session

The session object passed to function given to shinyServer.

input_id

The id of the tabset object.

selected

The id of the tab to be selected.

Examples

if (interactive()){
 library(shiny)
 library(shiny.semantic)

 ui <- semanticPage(
   actionButton("changetab", "Select Second Tab"),
   tabset(
      tabs = list(
          list(menu = "First Tab", content = "First Tab", id= "first_tab"),
          list(menu = "Second Tab", content = "Second Tab", id = "second_tab")
      ),
      active = "first_tab",
      id = "exampletabset"
   )
 )

 server <- function(input, output, session) {
     observeEvent(input$changetab,{
         update_tabset(session, "exampletabset", "second_tab")
     })
 }

 shinyApp(ui, server)
}

shiny.semantic

Semantic UI Support for Shiny

v0.4.2
MIT + file LICENSE
Authors
Filip Stachura [aut], Dominik Krzeminski [cre], Krystian Igras [aut], Adam Forys [aut], Paweł Przytuła [aut], Jakub Chojna [aut], Olga Mierzwa-Sulima [aut], Ashley Baldry [ctb], Jakub Chojna [ctb], Olga Mierzwa-Sulima [ctb], Pedro Manuel Coutinho da Silva [ctb], Paweł Przytuła [ctb], Kamil Żyła [ctb], Rabii Bouhestine [ctb], Appsilon Sp. z o.o. [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.