Skip to content

Function: select()

ts
function select(props: UiSelectFieldProps): Element;

Defined in: src/UI/blocks/select.tsx:53

Select field component for dropdown selection.

Parameters

ParameterTypeDescription
propsUiSelectFieldPropsConfiguration object

Returns

Element

Examples

Simple usage with required props

select({
  name: 'country',
  label: 'Country',
  items: [
    { value: 'us', label: 'United States' },
    { value: 'uk', label: 'United Kingdom' },
    { value: 'ca', label: 'Canada' }
  ]
});

Usage with default value

select({
  name: 'favoriteColor',
  label: 'Favorite Color',
  placeholder: 'Select your favorite color',
  items: [
    { value: 'red', label: 'Red' },
    { value: 'blue', label: 'Blue' },
    { value: 'green', label: 'Green' }
  ],
  defaultValue: 'blue',
  required: true,
  disabled: false
});

Matterway Assistant SDK Documentation