Skip to content

Instantly share code, notes, and snippets.

@JohnCoene
Created July 15, 2020 20:35
Show Gist options
  • Save JohnCoene/d2ff11bcdab5f7c61330abfcf30124b3 to your computer and use it in GitHub Desktop.
Save JohnCoene/d2ff11bcdab5f7c61330abfcf30124b3 to your computer and use it in GitHub Desktop.
Custom navigation
library(shiny)
ui <- navbarPage(
"example",
id = "tabs",
header = list(
tags$style("nav{display:none;}")
),
tabPanel(
"home",
actionButton("switch", "Go to networks tab")
),
tabPanel(
"networks",
h3("Hello!")
)
)
server <- function(input, output, session){
observeEvent(input$switch, {
updateTabsetPanel(session = session, inputId = "tabs", selected = "networks")
})
}
shinyApp(ui, server)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment