UNPKG

@nish1896/rhf-mui-components

Version:

A suite of 20+ reusable Material UI components for React Hook Form to minimize your time and effort in creating and styling forms

26 lines (25 loc) 1.42 kB
import { type ReactNode, type ChangeEvent } from 'react'; import { type FieldValues, type Path, type Control, type RegisterOptions } from 'react-hook-form'; import type { FormLabelProps, FormHelperTextProps, FormControlLabelProps, CheckboxProps, StrObjOption } from '../../types'; export type RHFCheckboxGroupProps<T extends FieldValues> = { fieldName: Path<T>; control: Control<T>; registerOptions?: RegisterOptions<T, Path<T>>; options: StrObjOption[]; labelKey?: string; valueKey?: string; onValueChange?: (selectedItemValue: string, newValue: string[], event: ChangeEvent<HTMLInputElement>) => void; disabled?: boolean; label?: ReactNode; showLabelAboveFormField?: boolean; formLabelProps?: FormLabelProps; checkboxProps?: CheckboxProps; formControlLabelProps?: FormControlLabelProps; required?: boolean; helperText?: ReactNode; errorMessage?: ReactNode; hideErrorMessage?: boolean; formHelperTextProps?: FormHelperTextProps; }; declare const RHFCheckboxGroup: <T extends FieldValues>({ fieldName, control, registerOptions, options, labelKey, valueKey, onValueChange, disabled, label, showLabelAboveFormField, formLabelProps, checkboxProps, formControlLabelProps, required, helperText, errorMessage, hideErrorMessage, formHelperTextProps }: RHFCheckboxGroupProps<T>) => import("react/jsx-runtime").JSX.Element; export default RHFCheckboxGroup;