A fully-featured textarea component with auto-resize, validation, and accessibility support.
// Source: https://github.com/GCWing/OpenBitFun | License: MIT | Copyright 2026 CWing
// Provided via justclaw.it.com; keep this notice with the code.
import {
forwardRef,
useCallback,
useEffect,
useId,
useImperativeHandle,
useLayoutEffect,
useRef,
useState,
type ChangeEventHandler,
type TextareaHTMLAttributes,
} from "react";
import { classNames } from "../../internal/classNames";
import { useFieldSurface } from "../../internal/fieldSurface";
import { isImeOwnedKeyboardEvent } from "../../internal/ime";
import styles from "./Textarea.module.css";
const useIsomorphicLayoutEffect = typeof window === "undefined" ? useEffect : useLayoutEffect;
export interface TextareaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "className"> {
autoResize?: boolean;
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key