| showGlassTab | R Documentation |
showGlassTab() makes a hidden tab visible again.
hideGlassTab() hides a tab from the navigation bar. If the hidden tab is
currently active, the first remaining visible tab is activated automatically.
showGlassTab(session, id, value)
hideGlassTab(session, id, value)
session |
Shiny session object. |
id |
Module id matching the |
value |
Value of the tab to show or hide. |
Called for its side effect; returns NULL invisibly.
Other glass tabs:
appendGlassTab(),
disableGlassTab(),
glassTabCondition(),
glassTabPanel(),
glassTabsOutput(),
glassTabsServer(),
glassTabsUI(),
renderGlassTabs(),
updateGlassTabBadge(),
updateGlassTabsUI()
if (interactive()) {
library(shiny)
ui <- fluidPage(
useGlassTabs(),
glassTabsUI(
"tabs",
glassTabPanel("a", "A", p("Tab A"), selected = TRUE),
glassTabPanel("b", "B", p("Tab B")),
glassTabPanel("admin", "Admin", p("Admin only"))
),
checkboxInput("is_admin", "Admin mode", FALSE)
)
server <- function(input, output, session) {
observeEvent(input$is_admin, {
if (input$is_admin) showGlassTab(session, "tabs", "admin")
else hideGlassTab(session, "tabs", "admin")
}, ignoreInit = FALSE)
}
shinyApp(ui, server)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.