The value of the chosen option (required); null or a value of no option shows the placeholder. With multiple, the values of the chosen options (string[])
onChange
(option: SelectOption) => void
—
Called with the option a person chooses (required). With multiple, (options: SelectOption[]) => void, called with the options chosen in their order
multiple
boolean
false
Several options can be chosen; each press checks or unchecks one and the menu stays open (options with a group: one chosen in each group)
valueDisplay
"summary" | "labels"
"summary" ("labels" with groups)
How the field writes several choices: the one label, the count (3 selected) or allSelectedLabel; or the chosen labels joined by a middle dot, at a row's end the row's value (under its label once it does not fit beside it)
groups
readonly SelectGroup[]
—
With multiple: how the groups of the options (SelectOption.group) show, a heading or a submenu; the menu parts each group from the next
allSelectedLabel
string
"All selected"
The field's text when a multiple select has every option chosen
Fills the width; false makes the field as wide as its value
invalid
boolean
false
Draws the field in the error color
disabled
boolean
false
Dims the field and takes no presses
aria-label
string
—
Name of the field and its menu for assistive technology
picker
"dialog" | "menu" | "sheet"
"menu" on iOS; "dialog" on Android ("menu" with multiple)
What a press opens: the menu of the options (a row's menu in a List row), a bottom sheet of rows, or on Android the choice dialog (radio rows; with multiple, checkbox rows, Cancel and OK). iOS has no dialog: it opens the menu; options in groups never open the dialog
title
string
the aria-label
The title of the picker dialog or sheet (picker "dialog" or "sheet"), the setting's name
cancelLabel
string
"Cancel"
Android: the button that closes the picker dialog (picker="dialog") with no change
okLabel
string
"OK"
Android: the button of a multiple select's picker dialog (picker="dialog") that applies the rows checked
testID
string
—
Test id; the menu (Android: the dialog) takes <testID>-menu, the sheet <testID>-sheet, each option <testID>-option-<value>, a submenu's row <testID>-group-<key>, Android's Cancel <testID>-cancel and OK <testID>-ok