TextArea
A multiline text input built on React Aria’s TextField with a TextArea element.
Manages label association, validation state, and error messages automatically.
Add via CLI
Section titled “Add via CLI”npx @a2ra/cli add text-areaRequired with description
Section titled “Required with description”Disabled state
Section titled “Disabled state”With validation error
Section titled “With validation error”Example JSON
Section titled “Example JSON”{ "type": "TextArea", "props": { "label": "Comments", "name": "comments", "rows": 4, "isRequired": true, "maxLength": 500, "description": "Max 500 characters." }}| Prop | Type | Description |
|---|---|---|
label | string | Visible field label (always provide one, or the field is unlabeled) |
placeholder | string | Placeholder text shown when empty |
name | string | Form field name (also the form-state key) |
value / defaultValue | string | Controlled / uncontrolled value |
rows | number | Visible text rows (positive integer) |
isDisabled / isRequired / isReadOnly / isInvalid | boolean | React Aria field states |
autoFocus | boolean | Focus on mount |
autoComplete | string | HTML autocomplete hint |
validationBehavior | "aria" | "native" | Validation display mode |
minLength / maxLength | number | Length constraints |
description | string | Help text associated via aria-describedby |
errorMessage | string | Error text shown when invalid |
- Renders a real
<textarea>; height is user-resizable vertically (resize-y), disabled whenisDisabled. - Single-line-only
TextFieldprops (type,pattern,inputMode) are intentionally absent from the schema. - Validation errors render through React Aria’s error slot and are announced to assistive technology.