selectInput.Rd
Create a select input. Select elements typically appear as a simple menu of choices and may have one selected choice. A group select input is a select input with one or two additional components. These addon components are used to change the reactivity or value of the input, see Details for more information.
selectInput( id, choices = NULL, values = choices, selected = values[[1]], ..., placeholder = NULL ) updateSelectInput( id, choices = NULL, values = choices, selected = choices[[1]], enable = NULL, disable = NULL, valid = NULL, invalid = NULL, session = getDefaultReactiveDomain() ) groupSelectInput( id, choices, values = choices, selected = values[[1]], ..., left = NULL, right = NULL ) updateGroupSelectInput( id, choices = NULL, values = choices, selected = NULL, enable = NULL, disable = NULL, valid = NULL, invalid = NULL, session = getDefaultReactiveDomain() )
id | A character string specifying the id of the reactive input. |
---|---|
choices | A character vector specifying the input's choices. |
values | A character vector specifying the values of the input's
choices, defaults to |
selected | One 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 the placeholder text of
the select input, defaults to |
enable | One of |
disable | One of |
valid | A character string specifying a message to the user indicating
how the input's value is valid, defaults to |
invalid | A character string specifying a message to the user
indicating how the input's value is invalid, defaults to |
session | A reactive context, defaults to |
left, right | A character vector specifying static addons or
If
The button does not change the value of the group input. However, the input no longer triggers event when the text box is updated. Instead the value is updated when a button is clicked. Static addons are still applied to the group input value.
The value of the group input does chance depending on the clicked dropdown menu item. The value of the input group is the concatenation of the dropdown input value, the value of the text input, and any static addons. |
Other inputs:
buttonGroupInput()
,
buttonInput()
,
checkbarInput()
,
checkboxInput()
,
chipInput()
,
fileInput()
,
formInput()
,
listGroupInput()
,
menuInput()
,
navInput()
,
radioInput()
,
radiobarInput()
,
rangeInput()
,
textInput()
### Simple select input selectInput( id = "select1", choices = c( "Choice 1", "Choice 2", "Choice 3" ), values = list(1, 2, 3) )#> <div class="yonder-select" id="select1"> #> <input type="text" class="form-control custom-select" data-toggle="dropdown" data-boundary="window" placeholder="Choice 1"/> #> <div class="dropdown-menu"> #> <button class="dropdown-item active" value="1">Choice 1</button> #> <button class="dropdown-item" value="2">Choice 2</button> #> <button class="dropdown-item" value="3">Choice 3</button> #> </div> #> <div class="valid-feedback"></div> #> <div class="invalid-feedback"></div> #> </div>### Group select input groupSelectInput( id = "select2", choices = 1:5, left = "$", right = ".00" ) %>% width(10)#> <div class="yonder-group-select input-group w-10" id="select2"> #> <div class="input-group-prepend"> #> <span class="input-group-text">$</span> #> </div> #> <select class="custom-select"> #> <option selected value="1">1</option> #> <option value="2">2</option> #> <option value="3">3</option> #> <option value="4">4</option> #> <option value="5">5</option> #> </select> #> <div class="input-group-append"> #> <span class="input-group-text">.00</span> #> </div> #> <div class="valid-feedback"></div> #> <div class="invalid-feedback"></div> #> </div>