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 | - | string The label for the select field |
isInvalid? | - | boolean If |
isRequired? | - | boolean If |
isDisabled? | - | boolean If |
helperText? | - | string Text that provides additional guidance to the user |
errorMessage? | - | string The error message to display if |
onChange? | - | ChangeEventHandler<HTMLSelectElement> |
placeholder? | - | string The 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 |