@rws-air/webcomponents
Version:
Standard Webcomponents for AIR projects
34 lines • 1.19 kB
TypeScript
/// <reference types="react" />
import { RadioGroupProps as MUIRadopGroupProps } from 'formik-mui';
/** The possible types for the option value */
export declare type OptionValue = string | number | boolean;
export interface Option<T extends OptionValue> {
/** The value for the option */
value: T;
/** The label shown next to the radio button */
label: string;
}
export interface RadioGroupProps<T extends OptionValue> extends MUIRadopGroupProps {
/** The options for the radio buttons */
options: Option<T>[];
/** Whether this field is required */
required?: boolean;
/** Data-qa for the Radio Group */
'data-qa'?: string;
}
/**
* Constructs a radio button group with formik validation
* @param componentProps Props to pass to the component
* @example
* ```jsx
* <Field
* component={RadioGroup}
* name='type'
* data-qa='sample-radio-group'
* required
* options={ [{ value: 'JOHN', label: 'John'}, { value: 'CONNOR', label: 'Connor'}] }
* />
* ```
*/
export declare const RadioGroup: <T extends OptionValue>({ options, "data-qa": dataQa, ...props }: RadioGroupProps<T>) => JSX.Element;
//# sourceMappingURL=index.d.ts.map