API and Development
TextArea provides a multi-line text input component with comprehensive form features including labels, helper text, error and success states, character counting, and automatic resizing. Built on Radix UI's TextArea component, it ensures consistent textarea patterns across the interface with full accessibility support, validation feedback, and flexible sizing options for various content lengths.
| Name | Default | Description |
|---|---|---|
label | Label text displayed above the textarea. LocalizedMessage from formatMessage. | |
labelColor | Color theme for the label. Options: Base, Error, Success. | |
placeholder | Placeholder text displayed when the textarea is empty. LocalizedMessage | DisplayValue—copy from formatMessage, or data from toDisplayValue. | |
helperText | Helper text displayed below the textarea. LocalizedMessage | DisplayValue. | |
error | false | Whether the textarea is in an error state. |
errorMessage | Error message to display (replaces helper text when provided). LocalizedMessage | DisplayValue. | |
success | false | Whether the textarea is in a success state. |
value | Controlled value of the textarea. | |
onChange | Callback fired when the textarea value changes: (event: React.ChangeEvent<HTMLTextAreaElement>) => void. | |
disabled | false | Whether the textarea is disabled. |
readOnly | false | Whether the textarea is read-only. |
required | false | Whether the textarea is required for form submission. |
resizeMode | None | Resize behavior: None, Auto (grow with content), or Vertical (drag handle). Import { ResizeMode } from @prepared911/ui and pass e.g. resizeMode={ResizeMode.Auto}. |
minRows | 3 | Minimum number of rows to display (only applies when resizeMode is Auto). |
maxRows | 10 | Maximum number of rows to display (only applies when resizeMode is Auto). |
rows | 3 | Number of visible text lines (ignored when resizeMode is Auto). |
maxLength | Maximum number of characters allowed. Displays character counter when provided. | |
minLength | Minimum number of characters required. | |
id | Unique identifier for the textarea field. | |
name | Name attribute for form submission. | |
autoFocus | false | Whether to automatically focus the textarea on mount. |
containerClassName | Custom class name for the container element. | |
className | Custom class name for the textarea field. |
value without updating it from state; the textarea keeps its own text as the user types.
maxRows, and shrinks when content is removed, down to minRows.
Configure auto-resize behavior with custom row limits.