dgz-ui-shared
Version:
Custom ui library using React.js, Shadcn/ui, TailwindCSS, Typescript, dgz-ui library
21 lines • 981 B
TypeScript
import { type FormItemProps, RadioGroupItem } from 'dgz-ui/form';
import type { FieldValues } from 'react-hook-form';
import React from 'react';
type RadioItemProps = React.ComponentPropsWithoutRef<typeof RadioGroupItem>;
type MyRadioProps<TFieldValues extends FieldValues> = FormItemProps<TFieldValues> & RadioItemProps;
/**
* MyRadio is a radio input that can integrate with react-hook-form when control and name are provided.
* Falls back to an uncontrolled radio item when not used inside a form.
*
* @template TFieldValues - Form values type used by react-hook-form.
* @param control
* @param name
* @param label
* @param rules
* @param helperText
* @param value
* @param props - Radio item and form item props.
*/
declare const MyRadio: <TFieldValues extends FieldValues>({ control, name, label, rules, helperText, value, ...props }: MyRadioProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
export { MyRadio };
//# sourceMappingURL=MyRadio.d.ts.map