Description Usage Arguments Value Examples
Dynamically show or hide a tab_panel
or navbar_menu
1 2 3 |
session |
The |
id |
The id of the navbar object |
target |
The tab value to toggle visibility |
Changes to the visibility of a tab in the shiny UI.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | if (interactive()) {
library(shiny)
library(shiny.semantic)
ui <- navbar_page(
title = "App Title",
id = "navbar",
tab_panel(
"Plot",
action_button("hide", "Hide Table"),
action_button("show", "Show Table"),
value = "plot"
),
tab_panel("Summary", value = "summary"),
tab_panel("Table", value = "table")
)
server <- function(input, output, session) {
observeEvent(input$hide, hide_tab(session, "navbar", "table"))
observeEvent(input$show, show_tab(session, "navbar", "table"))
}
shinyApp(ui, server)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.