Description Usage Arguments Example simple application Example inline chips See Also Examples
The chip input is a selectize alternative. Choices are selected from a
dropdown menu and appear as chips below the input's text box. Chips do not
appear in the order they are selected. Instead chips are shown in the order
specified by the choices
argument. Use the max
argument to limit the
number of choices a user may select.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
id |
A character string specifying the id of the reactive input. |
choices |
A character vector or list specifying the possible choices. |
values |
A character vector or list of strings specifying the input's
values, defaults to |
selected |
One or more of |
... |
Additional named arguments passed as HTML attributes to the parent element or tag elements passed as child elements to the parent element. |
placeholder |
A character string specifying placeholder text of the
chip input, defaults to |
max |
A number specifying the maximum number of items a user may select,
defaults to |
inline |
One of |
sort |
One of
|
enable |
One of |
disable |
One of |
session |
A reactive context, defaults to |
ui <- container( chipInput( id = "chips", choices = paste("Option number", 1:10), values = 1:10, inline = 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()
,
checkbarInput()
,
checkboxInput()
,
fileInput()
,
formInput()
,
listGroupInput()
,
menuInput()
,
navInput()
,
radioInput()
,
radiobarInput()
,
rangeInput()
,
selectInput()
,
textInput()
1 2 3 4 5 6 7 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.