dgz-ui-shared
Version:
Custom ui library using React.js, Shadcn/ui, TailwindCSS, Typescript, dgz-ui library
24 lines • 1.38 kB
TypeScript
import { FormItemProps, TextareaProps } from 'dgz-ui/form';
import { FieldValues } from 'react-hook-form';
/**
* Props for the MyTextarea component.
* @template TFieldValues - The type of the form values.
*/
export type MyTextareaProps<TFieldValues extends FieldValues> = FormItemProps<TFieldValues> & TextareaProps;
/**
* MyTextarea is a textarea component with optional react-hook-form integration.
* Supports floating error message styling.
*
* @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 textarea.
* @param required - Whether the field is required.
* @param rules - The `react-hook-form` validation rules.
* @param className - Custom CSS class name.
* @param floatingError - Whether to show the error message in a floating container.
* @param props - Textarea and form item props.
* @returns {JSX.Element | null} A textarea component integrated with react-hook-form, or null if name/control are missing
*/
export declare const MyTextarea: <TFieldValues extends FieldValues>({ control, name, label, required, rules, className, floatingError, ...props }: MyTextareaProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element | null;
//# sourceMappingURL=MyTextarea.d.ts.map