UNPKG

dgz-ui-shared

Version:

Custom ui library using React.js, Shadcn/ui, TailwindCSS, Typescript, dgz-ui library

20 lines 1.12 kB
import { CheckboxProps, FormItemProps } from 'dgz-ui/form'; import { FieldValues } from 'react-hook-form'; /** * Props for the MyCheckbox component. * @template TFieldValues - The type of the form values. */ export type MyCheckboxProps<TFieldValues extends FieldValues> = FormItemProps<TFieldValues> & CheckboxProps; /** * MyCheckbox is a checkbox component with optional react-hook-form integration. * * @template TFieldValues - Form values type used by react-hook-form. * @param control - The `react-hook-form` control object. * @param name - The name of the field in `react-hook-form`. * @param label - The label to display for the checkbox. * @param rules - The `react-hook-form` validation rules. * @param props - Checkbox and form item props. * @returns {JSX.Element | null} A checkbox component wrapped with form handling logic, or null if name/control are missing */ export declare const MyCheckbox: <TFieldValues extends FieldValues>({ control, name, label, rules, ...props }: MyCheckboxProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element | null; //# sourceMappingURL=MyCheckbox.d.ts.map