@devopness/ui-react
Version:
Devopness Design System React Components - Painless essential DevOps to everyone
41 lines (40 loc) • 1.35 kB
TypeScript
import { RefObject, TextareaHTMLAttributes } from 'react';
import { LabelProps } from '../../Primitives';
/**
* Props for the TextArea component.
*/
type TextAreaProps = TextareaHTMLAttributes<HTMLTextAreaElement> & {
/** Reference to the underlying textarea element. Can be RefObject or callback ref */
inputRef?: RefObject<HTMLTextAreaElement> | ((instance: HTMLTextAreaElement | null) => void);
/** Error information to display below the textarea. */
error?: Record<string, unknown> | undefined | null;
/** Disable textarea resize when true.
* @default true
*/
isResizable?: boolean;
/** Optional label props for the field. */
label?: LabelProps;
/** Optional className to pass to the container. */
className?: string;
};
/**
* TextArea component
*
* A styled multiline text input that supports an optional label,
* an error message and optional resize control.
*
* @example
* ```tsx
* <TextArea
* id="notes"
* name="notes"
* placeholder="Type here..."
* label={{ htmlFor: 'notes', value: 'Notes' }}
* inputRef={ref}
* error={{ message: 'Required' }}
* />
* ```
*/
declare const TextArea: ({ className, inputRef, error, label, isResizable, ...props }: TextAreaProps) => import("react/jsx-runtime").JSX.Element;
export { TextArea };
export type { TextAreaProps };