A selectize alternative.
chipInput(id, choices, values = choices, selected = NULL, ...,
max = NULL, fill = TRUE)
A character string specifying the id of the reactive input.
A character vector or list specifying the possible choices.
A character vector or list of strings specifying the input's
values, defaults to choices
.
One or more of values
specifying which values are selected
by default.
Additional named arguments passed as HTML attributes to the parent element.
A number specifying the maximum number of items a user may select.
One of TRUE
or FALSE
specifying the layout of chips. If
TRUE
chips fill the width of the parent element, otherwise if FALSE
the
chips are rendered inline, defaults to TRUE
.
ui <- container( chipInput( id = "chips", choices = paste("Option number", 1:10), values = 1:10, fill = TRUE ) %>% width("1/2") )server <- function(input, output) {
}
shinyApp(ui, server)
ui <- container( chipInput( id = "chips", choices = c( "A rather long option, isn't it?", "Shorter", "A middle-size option", "One more" ), values = 1:4, fill = FALSE ) %>% width("1/2") %>% background("blue") %>% shadow("small") )server <- function(input, output) {
}
shinyApp(ui, server)
Other inputs: buttonGroupInput
,
buttonInput
, checkboxInput
,
fileInput
, formInput
,
groupInput
, listGroupInput
,
menuInput
, navInput
,
radioInput
, rangeInput
,
selectInput
, sliderInput
,
textInput
# NOT RUN {
### Default input
chipInput(
id = "chip1",
choices = paste("Choice", 1:5)
)
# }
Run the code above in your browser using DataLab