R/optionalInput.R
optionalSliderInputValMinMax.RdThe optionalSliderInput() function needs three arguments to determine
whether to hide the sliderInput widget or not. For teal modules we specify an
optional slider input with one argument here called value_min_max.
optionalSliderInputValMinMax(
inputId,
label,
value_min_max,
label_help = NULL,
...
)The input slot that will be used to access the value.
Display label for the control, or NULL for no label.
(numeric(1) or numeric(3))
If of length 1 then the value gets set to that number and the sliderInput will be hidden.
Otherwise, if it is of length three the three elements will map to value, min and max of
the optionalSliderInput() function.
(shiny.tag) optional
object of class shiny.tag, e.g. an object returned by shiny::helpText()
optional arguments to sliderInput
(shiny.tag) HTML tag with range sliderInput widget.
For teal modules we parameterize an optionalSliderInput with one argument
value_min_max
ui <- bslib::page_fluid(
shinyjs::useShinyjs(),
optionalSliderInputValMinMax("a1", "b1", 1), # Hidden
optionalSliderInputValMinMax("a2", "b2", c(3, 1, 5)) # Shown
)
if (interactive()) {
shiny::shinyApp(ui, function(input, output) {})
}