UNPKG

mui-rff

Version:

Set of modern wrapper components to facilitate using Material UI with React Final Form

25 lines (24 loc) 1.09 kB
import { FormControlLabelProps, FormControlProps, FormGroupProps, FormHelperTextProps, FormLabelProps, SwitchProps as MuiSwitchProps } from '@mui/material'; import { default as React } from 'react'; import { FieldProps } from 'react-final-form'; import { ShowErrorFunc } from './Util'; export interface SwitchData { disabled?: boolean; label: string | number | React.ReactElement; value: unknown; } export interface SwitchesProps extends Partial<Omit<MuiSwitchProps, 'onChange'>> { data: SwitchData | SwitchData[]; fieldProps?: Partial<FieldProps<any, any>>; formControlLabelProps?: Partial<FormControlLabelProps>; formControlProps?: Partial<FormControlProps>; formGroupProps?: Partial<FormGroupProps>; formHelperTextProps?: Partial<FormHelperTextProps>; formLabelProps?: Partial<FormLabelProps>; helperText?: React.ReactNode; label?: string | number | React.ReactElement; name: string; required?: boolean; showError?: ShowErrorFunc; } export declare function Switches(props: SwitchesProps): import("react/jsx-runtime").JSX.Element;