A select list input similar to shiny::selectInput()
that can be
included in an inline()
wrapper.
Arguments
- id
The
input
slot that will be used to access the value.- choices
Vector or list of values to select from. Provide one of the following:
Use an unnamed character vector, such as
c("dog", "cat", "bee")
, for the most basic case, where you have a list of strings you want the user to select from.Use a named character vector, such as
c("Dog" = "dog", "Nice Kitty" = "cat", "Bee" = "bee")
if you want the options displayed to the user (the names; here, Dog, Nice Kitty, and Bee) to differ from the values passed to Shiny (the values; here,"dog"
,"cat"
, and"bee"
).Use a named list, where each element is a "sub-list", to group the items under headings; the names at the top level of the list will be the heading titles and the "sub-lists" are the items appearing under that heading. For example, if you pass
list(Mammals = c("Dog" = "dog", "Nice Kitty" = "cat"), Invertebrates = c("Bee" = "bee"))
then Dog and Nice Kitty will appear under the Mammals heading, while Bee will appear under the Invertebrates heading, and the value passed to the Shiny server will be either"dog"
,"cat"
, or"bee"
.
- selected
The initially selected option's value. If
NULL
, use the first item inchoices
.- multiple
Whether to allow multiple selections. As of inshiny version 0.1.0, the version of inline_select with
multiple = TRUE
looks and behaves a bit differently from the version of inline_select withmultiple = FALSE
. The package authors are working on eliminating this inconsistency.- meaning
A descriptive label, for people using assistive technology such as screen readers.
Value
An inline widget to be included in an inline()
wrapper.
See also
shiny::selectInput for how the select input works with your Shiny server.