numericRangeInput: Numeric Range Input

Description Usage Arguments Examples

View source: R/input-numericRange.R

Description

Create an input group of numeric inputs that function as a range input.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
numericRangeInput(
  inputId,
  label,
  value,
  width = NULL,
  separator = " to ",
  min = NA,
  max = NA,
  step = NA
)

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

The initial value(s) for the range. A numeric vector of length one will be duplicated to represent the minimum and maximum of the range; a numeric vector of two or more will have its minimum and maximum set the minimum and maximum of the range.

width

The width of the input, e.g. '400px', or '100%'; see validateCssUnit().

separator

String to display between the start and end input boxes.

min

Minimum allowed value

max

Maximum allowed value

step

Interval to use when stepping between min and max

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
if (interactive()) {

### examples ----

# see ?demoNumericRange
demoNumericRange()


###  basic usage ----

library( shiny )
library( shinyWidgets )


ui <- fluidPage(

  tags$br(),

  numericRangeInput(
    inputId = "noui1", label = "Numeric Range Input:",
    value = c(100, 400)
  ),
  verbatimTextOutput(outputId = "res1")

)

server <- function(input, output, session) {

  output$res1 <- renderPrint(input$noui1)

}

shinyApp(ui, server)


}

Example output



shinyWidgets documentation built on Sept. 17, 2021, 5:06 p.m.