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.
Arguments
- session
Shiny session object.
- id
Module id matching the
idpassed toglassTabsUI().- value
Value of the tab to disable or enable.
Examples
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)
}