Select
The select components are meant to be used when there are many options the user can choose from, especially when there's not much space available.
These components do not support re-ordering, in that case the Transfer component might be a better fit.
Variants
SimpleSingleSelect
Use the <SimpleSingleSelect/> if the user can only choose one option.
Demo
<SimpleSingleSelect
idPrefix="required-prefix-value"
value={value}
onChange={onChange}
options={[
{ value: '1', label: 'One' },
{ value: '2', label: 'Two' },
{ value: '3', label: 'Three' },
]}
/>
Single select
warning
This component will be deprecated in favor of the SimpleSingleSelect component,
which is also described in this document. We have not decided when we'll remove
this component from the library to give developers the chance to migrate over time
while being able to upgrade the library's version without being forced to migrate to the new component.
Demo
<SingleSelectField label="Aggregation type">
<SingleSelectOption label="One" value="1" />
<SingleSelectOption label="Two" value="2" />
<SingleSelectOption label="Three" value="3" />
</SingleSelectField>