formstextarea
Textarea
Multi-line text input with autoresize support and form field integration.
Import#
Slot Structure#
Multi-line text input with optional header and footer slots.
Examples#
Variants#
Outline/subtle/ghost/none visual variants.
Sizes#
Textarea size scale from xs to xl.
Autoresize#
Autoresize growth with maxrows.
Header + Footer#
Build composer-like surfaces using header/footer slots.
API Reference#
Attributes#
Slot
root1 attributeTextarea wrapper that owns header, textarea, footer, and autoresize state.
Data Attributes
| Data Attribute | Description |
|---|---|
| data-focused | State or slot attribute exposed for styling hooks and selectors. |
Props#
| Prop | Type | Default | Description |
|---|---|---|---|
| autofocus | boolean | undefined | false | Whether to automatically focus the textarea on mount. |
| autofocusDelay | number | undefined | 0 | Delay in milliseconds before focusing the textarea. |
| autoresize | boolean | undefined | — | — |
| autoResize | boolean | undefined | false | Whether the textarea should automatically resize based on content. |
| autoResizeDelay | number | undefined | 0 | Delay in milliseconds before triggering autoresize on mount. |
| children | JSX.Element | — | Children elements, rendered inside the root below the textarea. |
| class | ClassValue | — | Class applied to the component root or trigger element. |
| classes | TextareaT.Classes | undefined | — | — |
| defaultValue | TextareaT.Value | — | The default value of the input (uncontrolled). |
| disabled | boolean | undefined | false | Whether the input is disabled. |
| footer | JSX.Element | — | Element to render below the textarea. |
| header | JSX.Element | — | Element to render above the textarea. |
| id | string | undefined | — | The ID of the input element. |
| maxLength | string | number | undefined | — | Maximum character length for the textarea. |
| maxRows | number | undefined | 0 | Maximum number of rows allowed during autoresize. |
| modelModifiers | M | undefined | — | Modifiers for input processing (e.g., lazy, trim, number). |
| name | string | undefined | — | The name of the input element, used for form submission. |
| onBlur | JSX.FocusEventHandlerUnion<HTMLTextAreaElement, FocusEvent> | undefined | — | Native blur event handler. |
| onChange | ((value: ModifierValue<M>) => void) | undefined | — | Callback when the textarea value change is committed. |
| onFocus | JSX.FocusEventHandlerUnion<HTMLTextAreaElement, FocusEvent> | undefined | — | Native focus event handler. |
| onInput | JSX.InputEventHandlerUnion<HTMLTextAreaElement, InputEvent> | undefined | — | Native input event handler. |
| onValueChange | ((value: ModifierValue<M>) => void) | undefined | — | Callback when the textarea value changes during input. |
| placeholder | string | undefined | — | Placeholder text for the textarea. |
| readOnly | boolean | undefined | false | Whether the input is read-only. |
| ref | JSX.HTMLElementTags["div"] extends { ref?: infer Ref; } ? Ref : never | undefined | — | — |
| required | boolean | undefined | false | Whether the input is required. |
| rows | number | undefined | 3 | Default number of rows. |
| size | "xs" | "sm" | "md" | "lg" | "xl" | undefined | — | — |
| style | JSX.CSSProperties | undefined | — | — |
| styles | TextareaT.Styles | undefined | — | — |
| value | TextareaT.Value | — | The current value of the input (controlled). |
| variant | "none" | "outline" | "ghost" | "subtle" | undefined | — | — |