Optional Slider Input with minimal and maximal values
Source: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.
Arguments
- inputId
The
inputslot that will be used to access the value.- label
Display label for the control, or
NULLfor no label.- value_min_max
(
numeric(1)ornumeric(3))
If of length 1 then the value gets set to that number and thesliderInputwill be hidden. Otherwise, if it is of length three the three elements will map tovalue,minandmaxof theoptionalSliderInput()function.- label_help
(
shiny.tag) optional
object of classshiny.tag, e.g. an object returned byshiny::helpText()- ...
optional arguments to
sliderInput
Examples
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) {})
}