Learn R Programming

yonder (version 0.1.0)

sliderInput: Slider with custom choices

Description

A slider input with custom choices and values. Unlike rangeInput() or intervalInput() the slider input does range over a set of numeric values. Instead the slider input may be used similarly to a radio input.

Usage

sliderInput(id, choices, values = choices, selected = values[[1]], ...,
  ticks = TRUE, prefix = NULL, suffix = NULL, fill = FALSE)

Arguments

id

A character string specifying the id of the reactive input.

choices

A character vector specifying the slider labels.

values

A character vector specifying the values of the input, defaults to choices.

selected

One of values specifying the initial value of the slider input, defaults to values[[1]].

...

Additional named arguments passed as HTML attributes to the parent element.

ticks

One of TRUE or FALSE specifying if tick marks are added to the input, defaults to TRUE.

prefix

A character string specifying a prefix for the input value, defaults to NULL, in which case a prefix is not prepended.

suffix

A character string specifying a suffix for the input value, defaults to NULL, in which case a prefix is not appended.

fill

One of TRUE or FALSE specifying whether the filled portion of the slider input is shown, defaults to FALSE.

See Also

Other inputs: buttonGroupInput, buttonInput, checkboxInput, chipInput, fileInput, formInput, groupInput, listGroupInput, menuInput, navInput, radioInput, rangeInput, selectInput, textInput

Examples

Run this code
# NOT RUN {
### Custom chocies

# }
# NOT RUN {
<!-- % <script> -->
# }
# NOT RUN {
<!-- % $(function() { -->
# }
# NOT RUN {
<!-- %   $(".yonder-range").each(function() { -->
# }
# NOT RUN {
<!-- %     $(this.querySelector("input")).ionRangeSlider(); -->
# }
# NOT RUN {
<!-- %   }); -->
# }
# NOT RUN {
<!-- % }); -->
# }
# NOT RUN {
<!-- % </script> -->
# }
# NOT RUN {
# Select a value from a set of choices using a slider.

sliderInput(
  id = "slider1",
  choices = c("Closest", "Close", "Far", "Farthest")
)

# }

Run the code above in your browser using DataLab