mui-rff
Version:
Set of modern wrapper components to facilitate using Material UI with React Final Form
25 lines (24 loc) • 1.05 kB
TypeScript
import React from 'react';
import { FormControlLabelProps, FormControlProps, FormHelperTextProps, FormLabelProps, RadioProps as MuiRadioProps, RadioGroupProps } from '@mui/material';
import { ShowErrorFunc } from './Util';
import { FieldProps } from 'react-final-form';
export interface RadioData {
label: string | number | React.ReactElement;
value: unknown;
disabled?: boolean;
}
export interface RadiosProps extends Partial<Omit<MuiRadioProps, 'onChange'>> {
name: string;
data: RadioData[];
label?: string | number | React.ReactElement;
required?: boolean;
helperText?: React.ReactNode;
formLabelProps?: Partial<FormLabelProps>;
formControlLabelProps?: Partial<FormControlLabelProps>;
fieldProps?: Partial<FieldProps<any, any>>;
formControlProps?: Partial<FormControlProps>;
radioGroupProps?: Partial<RadioGroupProps>;
formHelperTextProps?: Partial<FormHelperTextProps>;
showError?: ShowErrorFunc;
}
export declare function Radios(props: RadiosProps): JSX.Element;