conditionalUI: Conditional UI

conditionalUIR Documentation

Conditional UI

Description

This function takes some UI element and a compiletime-evaluated expression and returns the UI element ONLY if the condition is true

Usage

conditionalUI(expression, ui_element)

Arguments

expression

compile-time evaluated expression (no server/reactive variables)

ui_element

the UI element to display if expression = TRUE

Value

if expression==TRUE: taglist wrapping passed UI element. If expression == FALSE, empty taglist

Examples

# In UI:
somevariable=TRUE
shinyWidgets::panel(
  heading="constitutivepanel",
  CRUX:::conditionalUI(
    somevariable, 
    shinyWidgets::panel(somevariable, heading="ConditionalPanel")
  ),
                    
  shiny::h1("constitutive title"),
  shiny::p("constitutive paragraph")
)

CCICB/CRUX documentation built on Jan. 28, 2024, 10:12 p.m.