Select

The Select component provides a way for the user to choose between several options within a dropdown.

Props

Examples

import { whisper } from '@oliveai/ldk';
import { WhisperComponentType } from '@oliveai/ldk/dist/whisper/types';

export const selectWhisper = async () => {
  await whisper.create({
    label: 'Select',
    components: [
      {
        type: WhisperComponentType.Select,
        excludeDefaultOption: false,
        label: 'Select Label',
        options: [
          'Option One',
          'Option Two',
          'Option Three',
        ],
        selected: 0,
        onSelect: (error, value) => {
          console.log('Selected: ', value);
        },
        validationError: '',
      },
    ],
  });
}

Last updated