Component libraryTextarea

Textarea

Free

Multiline input with auto sizing and a character count.

npx shadcn@latest add https://tidalui.com/r/textarea.json
Desktop viewport

Installation

Terminal
npx shadcn@latest add https://tidalui.com/r/textarea.json

Import components/ui/tidal.css, components/ui/textarea.css, then add the component inside a tidal-scope wrapper. Its scoped design tokens keep it independent of your existing CSS.

Usage

Complete example source · Dependency and asset manifest

Loading the complete example…

API & behavior

Required visible label. Native controlled value/onChange or uncontrolled defaultValue, textarea attributes/ref/name/required/disabled/readOnly/id, keyboard, selection and composition handlers supported. Native rows(default3) and vertical resizing remain available by default. Optional autoGrow(defaultfalse) measures actual native scrollHeight; minRows(default3) and maxRows(default8) finite values floor/clamp1..50, max is at least min, and autoGrow manages rows/height/minHeight/resize. Content grows/shrinks smoothly to the row limit and then scrolls; width/font changes remeasure in untransformed client coordinates. className applies to textarea, rootClassName to wrapper; other style props are retained. Optional maxLength floors finite nonnegative limits including0; invalid limits are omitted. Native user-input limit is preserved without truncating initial or external caller values. showCount defaults to true when maxLength is present, or opts into an unlimited count. Counts use native UTF-16 string length, matching maxLength; decorative rolling digits and a limit rail never announce each keystroke. formatCount(count,limit) localizes the visible/accessible text and replaces rolling digits. Count/help/error IDs merge with caller aria-describedby; error forces aria-invalid and role=alert; externally supplied over-limit text also sets aria-invalid without mutating the value. Uncontrolled change and native form reset update count and sizing, including prevented reset. Programmatic DOM-value changes without input events are outside React state; use a controlled value or dispatch the appropriate native input event. Native IME handlers are forwarded unchanged; no submission shortcut, wrapper form, collection, persistence or network work is introduced. Reduced motion makes counts, height, rail and feedback resolve immediately. Consumers own validation, submission and storage.

Style with the --t-* CSS variables. Set data-theme="dark" on your tidal-scope wrapper for a dark surface. Motion respects the system’s reduced-motion preference.

Building with an agent?Give it the installation guide and component catalog.