selectInputs: Tabular Select List Input Controls

Description Usage Arguments Value Author(s) Examples

Description

Create a select list that can be used to choose a single or multiple items from a list of values.

Usage

 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
selectInput_cell(
  inputId,
  label = "",
  choices,
  selected = NULL,
  multiple = FALSE,
  selectize = TRUE,
  width = "",
  size = NULL,
  disabled = FALSE,
  hidden = FALSE
)

selectInput_row(
  inputId,
  label = "",
  choices,
  selected = NULL,
  multiple = FALSE,
  selectize = TRUE,
  width = "",
  size = NULL,
  leftLabel = TRUE,
  disabled = FALSE,
  hidden = FALSE
)

Arguments

inputId

The input slot that will be used to access the value

label

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

choices

List of values to select from. If the elements of the list are named, then the name rather than the value is displayed to the user.

selected

The initially selected value (or multiple values if multiple = TRUE). If not specified then defaults to the first value for single-select lists and no values for multiple select lists.

multiple

Is selection of multiple items allowed?

selectize

Whether to use selectize.js or not.

width

The width of the input, e.g. '400px', or '100%'

size

Number of items to show in the selection box; a larger number will result in a taller box. Not compatible with selectize=TRUE. Normally, when multiple=FALSE, a select input will be a drop-down list, but when size is set, it will be a box instead.

leftLabel

Should the label column be the left column or the right column. TRUE puts the label on the left column.

...

Arguments passed to selectInput()

Value

selectInput_cell returns a character vector the length of inputId.

selectInput_row returns a data frame with two columns and a row for every element in inputId

Author(s)

Benjamin Nutter

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## Not run: 
options(pixiedust_print_method = "html")
shinyApp(
  ui = shinyUI(
    wellPanel(uiOutput("sampleUI"))
  ),
  
  server = shinyServer(function(input, output){
    output$sampleUI <- 
      renderText({ 
        selectInput_row(inputId = paste0("car", 1:nrow(mtcars)),
                        label = rownames(mtcars),
                        choices = LETTERS[1:5]) %>%
        dust() %>%
        print(asis = FALSE)
      })
  })
)

## End(Not run)

nutterb/shinydust documentation built on Dec. 6, 2020, 8:13 a.m.