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.

Props

Accepts InputBox props.

childrenReactNode

Usually accepts Select.OptionGroup and Select.Option.

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

Initial value when component is uncontrolled.

disabledboolean

Disables the select.

The value to show when nothing is selected

Gain access to the internal ref

keepInViewboolean

Attempts to keep popover in view clipping edges if too large.

Locks external scrollbars when open.

matchWidthsboolean | 'minimum'

Matches anchor and popover widths.

multipleIsMultiple

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.

onChangeunknown

Callback when an option has been selected/deselected.

optionsArray
label:string
optgroup:Array
value:V

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

placementPlacement

'top-start' | 'top' | 'top-end' | 'right-start' | 'right' | 'right-end' | 'bottom-start' | 'bottom' | 'bottom-end' | 'left-start' | 'left' | 'left-end'

Where to place the popover.

Accepts any valid Popover props.

renderToHTMLElement | string

Where to render the popover into. Accepts an HTML element or selector. Uses the closest fixed parent or document.body by default. This will only be computed once on initial render.

renderValue(item: any) => ReactNode

Control how the selected value is displayed.

tooltipObject

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

valueunknown

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.