v14.2.0

Playroom

Github

Select

View Source

Provide a list of options that can be selected. Replaces native select menus by using aria roles to enhance accessibility while allowing full customization of the options and what is used in the select popover. Composes InputBox and Popover.

Copy
Edit
Submit
Copy
Edit
Copy
Edit
Copy
Edit
Copy
Edit

Props

emptyValueany

The value to show when nothing is selected

Controls the initial Popover state: open or closed (default).

multipleboolean

Allows multiple selection of values. Note that value must be an array if using a controlled component and multiple is true.

namestring

Sets internal hidden input[s] to the current selected value[s]. Useful for components that collect data outside of React and need to be posted to a form.

onChangeFunction

Callback when an option has been selected/deselected. returns { value, selectedValue }

optionsArray
label:string
optgroup:Array
value:any

Pass an object instead of children for use when rendering in a non React environment.

renderValuenumber | string | ReactElement | Array | Function

Control how the selected value is displayed.

tooltipObject

Wraps Select in a Tooltip component. Accepts any valid Tooltip props.

valueboolean | string | number | Array | Function

Selected value[s]. Accepts any value besides undefined, also accepts a function that returns each Option’s value to determine what should be currently selected.

defaultValueboolean | string | number | Array | Function

Initial value when component is uncontrolled.

Accepts any valid Popover props.

  • Props
PreviousRangeSliderNextStepperField