UNPKG

@rws-air/webcomponents

Version:
36 lines 1.29 kB
/// <reference types="react" /> import { SelectProps } from 'formik-mui'; /** The possible types for the option value */ export declare type SelectMenuOptionValues = string | number | string[]; export interface SelectMenuOption<T extends SelectMenuOptionValues> { /** The value for the option */ value: T; /** The label shown next to the radio button */ label: string; } export interface SelectMenuProps<T extends SelectMenuOptionValues> extends SelectProps { /** The label of the select menu */ label: string; /** The selectable options for the select menu */ options: SelectMenuOption<T>[]; } /** * Constructs a Select Menu with the formik validation * @param props Props to pass to the select menu component * @example * ```jsx * <Field * component={SelectMenu} * name='type' * type='text' * required * placeholder='Example Placeholder' * variant='outlined' * data-qa='sample-select-menu' * label='Example' * options={ [{ value: 'JOHN', label: 'John'}, { value: 'CONNOR', label: 'Connor'}] } * /> * ``` */ export declare const SelectMenu: <T extends SelectMenuOptionValues>({ label, options, placeholder, className, autoFocus, required, ...props }: SelectMenuProps<T>) => JSX.Element; //# sourceMappingURL=index.d.ts.map