Skip to contents

[Stable] The 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.

Usage

optionalSliderInputValMinMax(
  inputId,
  label,
  value_min_max,
  label_help = NULL,
  ...
)

Arguments

inputId

The input slot that will be used to access the value.

label

Display label for the control, or NULL for no label.

value_min_max

(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.

label_help

(shiny.tag) optional
object of class shiny.tag, e.g. an object returned by shiny::helpText()

...

optional arguments to sliderInput

Value

(shiny.tag) HTML tag with range sliderInput widget.

Examples


optionalSliderInputValMinMax("a", "b", 1)
#> <div class="form-group shiny-input-container shinyjs-hide">
#>   <label class="control-label" id="a-label" for="a">b</label>
#>   <input class="js-range-slider" id="a" data-skin="shiny" data-min="0" data-max="2" data-from="1" data-step="1" data-grid="true" data-grid-num="2" data-grid-snap="false" data-prettify-separator="," data-prettify-enabled="true" data-keyboard="true" data-data-type="number"/>
#> </div>
optionalSliderInputValMinMax("a", "b", c(3, 1, 5))
#> <div class="form-group shiny-input-container">
#>   <label class="control-label" id="a-label" for="a">b</label>
#>   <input class="js-range-slider" id="a" data-skin="shiny" data-min="1" data-max="5" data-from="3" data-step="1" data-grid="true" data-grid-num="4" data-grid-snap="false" data-prettify-separator="," data-prettify-enabled="true" data-keyboard="true" data-data-type="number"/>
#> </div>