mui-rff
Version:
Set of modern wrapper components to facilitate using Material UI with React Final Form
25 lines (24 loc) • 1.07 kB
TypeScript
import React from 'react';
import { FormControlLabelProps, FormControlProps, FormGroupProps, FormHelperTextProps, FormLabelProps, SwitchProps as MuiSwitchProps } from '@mui/material';
import { ShowErrorFunc } from './Util';
import { FieldProps } from 'react-final-form';
export interface SwitchData {
label: string | number | React.ReactElement;
value: unknown;
disabled?: boolean;
}
export interface SwitchesProps extends Partial<Omit<MuiSwitchProps, 'onChange'>> {
name: string;
data: SwitchData | SwitchData[];
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 Switches(props: SwitchesProps): JSX.Element;