Select

The Select feature enables users to choose an option from a list within a form field. By default, the first option in the list is displayed. However, you can also configure a different option to be pre-selected from the list.

TypeResource
DesignFigma
WebWeb Storybook
CodeGitlab
Select an option

Helper text

Usage

import { Select } from 'bio-bind-ui';
<Select
  errorText='Error text'
  helperText='Helper text'
  id='select'
  label='Label'
  mode='light'
  name='select'
  options={[
    {
      label: 'Option 1',
      value: 'option-1',
    },
    {
      label: 'Option 2',
      value: 'option-2',
    },
    {
      label: 'Option 3',
      value: 'option-3',
    },
  ]}
  placeholder='Select an option'
  radius='md'
  required
  showInfo
  size='sm'
  style={{
    control: () => {},
  }}
  variant='outline'
/>

Examples

Variant

Use the variants outline, background, or underline to change style of the select.

Select an option

Helper text


Select an option

Helper text


Select an option

Helper text


Multiple (optional)

Use multiple to turn single into multiple select.

Select an option

Helper text


Size

Use the size sm, md, or lg to change the size of the select.

Select an option

Helper text


Select an option

Helper text


Select an option

Helper text


Radius

Use the radius none, xs, sm, md, lg, xl, or full to change the radius of the select.

Select an option

Helper text


Select an option

Helper text


Select an option

Helper text


Select an option

Helper text


Select an option

Helper text


Select an option

Helper text


Select an option

Helper text


Props

PropsRequiredDefaultTypedescription
idtrue-stringA unique identifier for the select.
nametrue-stringName prop is commonly used in form elements, such as select.
isMultiplefalsefalsebooleanIf true, select will be set to multiple select.
optionsfalse-OptionProps[]List of value options for multiple select.
placeholdertrue-stringPlacholder information to provide input select area information.
showInfofalsetruebooleanIf false, the filed select will be set not showing info.
isAsyncfalsefalsebooleanIf true, the filed select will be set showing async.
loadOptionsfalse-(inputValue: string) => Promise<OptionProps[]>Unique identifier for the load option select.
varianttrueoutlineoutline, background, underlineThe visual style variant of the select.
sizetruemdsm, md, lgThe size of the select
onChangetrue-(value: OptionProps or OptionProps[]) => voidCallback function to run when the select is clicked.
valuefalse-OptionProps or OptionProps[]The information value of the select.
defaultValuefalse-OptionProps or OptionProps[]The information default value of the select.
helperTextfalse-stringHelper text information to provide select information.
isErrorfalsefalsebooleanIf true, select will be set to error state.
errorTextfalse-stringError text information to provide select information if it is an error.
radiustruemdnone, xs, sm, md, lg, xl, fullCorner radius of the field select
labelfalse-stringThe label text for the select.
disabledfalsefalsebooleanIf true, select will be set to disabled state.
requiredtruefalsebooleanIf true, required state will be set for the select.
stylefalse-StylesConfig<OptionProps, boolean, GroupBase<OptionProps>>Custom styles for the select component.
modefalselightlight darkThe theme mode of the select (light or dark).
BIND © Biofarma Innovate Next-level Design .