UNPKG

dgz-ui-shared

Version:

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

20 lines 1.05 kB
import { FormItemProps, SwitchProps } from 'dgz-ui/form'; import { FieldValues } from 'react-hook-form'; /** * Props for the MySwitch component. * @template TFieldValues - The type of the form values. */ export type MySwitchProps<TFieldValues extends FieldValues> = FormItemProps<TFieldValues> & SwitchProps; /** * MySwitch is a toggle switch 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 switch. * @param rules - The `react-hook-form` validation rules. * @param props - Switch and form item props. * @returns A toggle switch component, or null if name or control are missing. */ export declare const MySwitch: <TFieldValues extends FieldValues>({ control, name, label, rules, ...props }: MySwitchProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element | null; //# sourceMappingURL=MySwitch.d.ts.map