| disableGlassTab | R Documentation |
disableGlassTab() grays out a tab and prevents the user from clicking it
without removing it from the navigation bar. enableGlassTab() reverses
this. Unlike hideGlassTab(), a disabled tab remains visible.
disableGlassTab(session, id, value)
enableGlassTab(session, id, value)
session |
Shiny session object. |
id |
Module id matching the |
value |
Value of the tab to disable or enable. |
Called for its side effect; returns NULL invisibly.
Other glass tabs:
appendGlassTab(),
glassTabCondition(),
glassTabPanel(),
glassTabsOutput(),
glassTabsServer(),
glassTabsUI(),
renderGlassTabs(),
showGlassTab(),
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("locked", "Locked", p("Locked content"))
),
checkboxInput("unlocked", "Unlock tab", FALSE)
)
server <- function(input, output, session) {
# Start with "locked" tab disabled
observe({
if (input$unlocked) enableGlassTab(session, "tabs", "locked")
else disableGlassTab(session, "tabs", "locked")
})
}
shinyApp(ui, server)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.