Skip to content

TextArea

A multiline text input built on React Aria’s TextField with a TextArea element. Manages label association, validation state, and error messages automatically.

Terminal window
npx @a2ra/cli add text-area
{
"type": "TextArea",
"props": {
"label": "Comments",
"name": "comments",
"rows": 4,
"isRequired": true,
"maxLength": 500,
"description": "Max 500 characters."
}
}
PropTypeDescription
labelstringVisible field label (always provide one, or the field is unlabeled)
placeholderstringPlaceholder text shown when empty
namestringForm field name (also the form-state key)
value / defaultValuestringControlled / uncontrolled value
rowsnumberVisible text rows (positive integer)
isDisabled / isRequired / isReadOnly / isInvalidbooleanReact Aria field states
autoFocusbooleanFocus on mount
autoCompletestringHTML autocomplete hint
validationBehavior"aria" | "native"Validation display mode
minLength / maxLengthnumberLength constraints
descriptionstringHelp text associated via aria-describedby
errorMessagestringError text shown when invalid
  • Renders a real <textarea>; height is user-resizable vertically (resize-y), disabled when isDisabled.
  • Single-line-only TextField props (type, pattern, inputMode) are intentionally absent from the schema.
  • Validation errors render through React Aria’s error slot and are announced to assistive technology.