Skip to main content

Select Input

Allows a user to choose from a pre-defined list.

Examples​

Default Select Input​

<SelectInput 
required
label="Label"
placeholder="Placeholder"
id="default-input"
size="small|medium(default)"
/>

With Helper Text​

Helper Text
Helper Text
<SelectInput 
...
helperText="Helper Text"
/>

With Critical, Warning, Success, and Disabled States​

Some kind of error
Some kind of error
Some kind of warning
Some kind of warning
Some kind of success
Some kind of success
No touching!
No touching!
<SelectInput 
...
state="critical|warning|success"
/>

With Icon​

<SelectInput ...>
<FormControlDecoration position="start|end">
<Icon name="search" />
</FormControlDecoration>
</SelectInput>

Loading​

<SelectInput 
...
loading
/>

Controlled Select Input​

<SelectInput 
...
value={someValue}
onChange={(evt, value) => ...}
/>

Props​

NameTypeDefault ValueRequiredDescription
fieldClassNamestringNoA className to apply to the field.
fieldPropsRecord<string, unknown>NoAny props to spread onto the field container.
helperTextReactNodeNoA string or component to display as helper text beneath the input
iconstring | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | ReactFragment | ReactPortal | nullNoAn icon to render at the front of the input.
labelReactNodeNoA string or component to display as a label above the input
loadingbooleanfalseNoShould the input display a loading state? Useful when options are being loaded via a remote request.
onChangeFormControlChangeEventHandler<InputType, string | number | readonly string[] | (string | number | readonly string[])[]> | undefinedNoEmit a new value when the input's selected value changes.
requiredbooleanfalseNoIs the field required?
size"small" | FormControlSize | "medium"FormControlSize.MediumNoThe size of the field
state"" | FormControlState | "critical" | "warning" | "success"FormControlState.DefaultNoThe state of the field