Select
A component that allows users to select one or more options from a list.
Examples
Helper text and placeholder
The placeholder prop and helperText can both be used to provide additional context for the Select.
Controlled state
Optionally use the value prop to control the selected option and onChange to update it.
Invalid state
If the isInvalid prop is set to true, the errorMessage contents will be displayed below the
input field, replacing any helperText.
Disabled option
The isDisabled prop can be used on an individual option to make it unselectable.
API Reference
Select
The main select component, wraps the options and provides the select input.
| Prop | Default | Description |
|---|---|---|
label | - | stringThe label for the select field |
isInvalid? | - | booleanIf |
isRequired? | - | booleanIf |
isDisabled? | - | booleanIf |
helperText? | - | stringText that provides additional guidance to the user |
errorMessage? | - | stringThe error message to display if |
onChange? | - | ChangeEventHandler<HTMLSelectElement> |
placeholder? | - | stringThe placeholder for the select. We render an |
Select.Option
A selectable option to be listed within the <Select />.
| Prop | Default | Description |
|---|---|---|
value? | - | string | number | readonly string[] |
isDisabled? | - | boolean |