| glassTabCondition | R Documentation |
Returns a JavaScript condition string that evaluates to TRUE when the
specified glasstabs widget has a given active tab. Pass the result directly
to the condition argument of shiny::conditionalPanel().
glassTabCondition(id, value)
id |
The |
value |
The tab value string (the |
A single character string for use in shiny::conditionalPanel().
Other glass tabs:
appendGlassTab(),
disableGlassTab(),
glassTabPanel(),
glassTabsOutput(),
glassTabsServer(),
glassTabsUI(),
renderGlassTabs(),
showGlassTab(),
updateGlassTabBadge(),
updateGlassTabsUI()
# Returns a plain JS condition string - no Shiny session needed:
glassTabCondition("main", "details")
# Inside a module - use ns() for the id:
# UI: glassTabCondition(ns("tabs"), "details")
# This produces: "input['mymod-tabs-active_tab'] === 'details'"
# Full app example showing conditionalPanel usage:
if (interactive()) {
library(shiny)
ui <- fluidPage(
useGlassTabs(),
glassTabsUI(
"main",
glassTabPanel("overview", "Overview", selected = TRUE,
p("Always visible.")),
glassTabPanel("details", "Details",
p("Detail pane."))
),
conditionalPanel(
condition = glassTabCondition("main", "details"),
wellPanel("This panel only shows on the Details tab.")
)
)
server <- function(input, output, session) {}
shinyApp(ui, server)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.