Getting started
Foundation
Typography
Navigation
Feedback
Forms
Multi select presents user with a set of options and allows to select many of them.
Select should be disabled, when user shouldn't be allowed to interact with it.
Individual options can be disabled too.
Mark select as loading, when options are fetched on the fly and are not yet available.
Invalid select indicates that current value isn't what the system expects.
Clearable select should be used when empty selection is acceptable.
Options can display an additional accessory view before the label. You can show an image using an image accessory. This is useful for showing logos when selecting sources or destinations, for example.
Icons can be accessories too.
You don't have to create objects with label and value keys as shown in the examples above.
MultiSelect supports any objects, as long as you provide a label and value for each option via optionLabel and optionValue functions.
There's a version of MultiSelect called GroupedMultiSelect, that supports groups of options.
| Name | Default | Description |
|---|---|---|
isDisabled | — | booleanDetermines if select is disabled. |
isLoading | — | booleanIndicates that options are being loaded. |
isInvalid | — | booleanIndicates that select is in invalid state. |
isClearable | false | booleanDetermines if selection can be cleared. |
isOptionDisabled | — | (option: Option) => booleanFunction to determine whether an option should be disabled. |
emptyOptionsMessage | "No options" | stringText to show inside a dropdown when there are no options. |
options | — | Option[]Available options. `Option` is a generic, so type of options will be inferred. |
optionLabel | — | (option: Option) => stringFunction to extract label from an option. If it's not provided, `label` field will be used as a label. |
optionValue | — | (option: Option) => OptionValueFunction to extract value from an option. If it's not provided, `value` field will be used as a value. |
optionAccessory | — | (option: Option) => SelectOptionAccessoryTypeFunction to show an accessory view near the option label. |
placeholder | — | stringPlaceholder text to show inside a select when nothing is selected. |
value | — | OptionValue[]Selected options. |
width | "xs" | "xs" | "sm" | "md" | "lg" | "xl" | "auto" | "100%"Select width. |
onChange | — | (value: OptionValue[]) => voidCallback for when user selects a different option or clears the selection. |
| Name | Default | Description |
|---|---|---|
isDisabled | — | booleanDetermines if select is disabled. |
isLoading | — | booleanIndicates that options are being loaded. |
isInvalid | — | booleanIndicates that select is in invalid state. |
isClearable | false | booleanDetermines if selection can be cleared. |
isOptionDisabled | — | (option: Option) => booleanFunction to determine whether an option should be disabled. |
emptyOptionsMessage | "No options" | stringText to show inside a dropdown when there are no options. |
optionGroups | — | Array<{
label: string;
options: Option[];
}>Available options. `Option` is a generic, so type of options will be inferred. |
optionLabel | — | (option: Option) => stringFunction to extract label from an option. If it's not provided, `label` field will be used as a label. |
optionValue | — | (option: Option) => OptionValueFunction to extract value from an option. If it's not provided, `value` field will be used as a value. |
optionAccessory | — | (option: Option) => SelectOptionAccessoryTypeFunction to show an accessory view near the option label. |
placeholder | — | stringPlaceholder text to show inside a select when nothing is selected. |
value | — | OptionValue[]Selected options. |
width | "xs" | "xs" | "sm" | "md" | "lg" | "xl" | "auto" | "100%"Select width. |
onChange | — | (value: OptionValue[]) => voidCallback for when user selects a different option or clears the selection. |