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