ref | React.Ref<HTMLTextAreaElement>Ref forwarded to the underlying <textarea> element. |
|---|
label | string · requiredLabel text for the textarea. Always rendered for accessibility. |
|---|
value | string · requiredCurrent value of the textarea. |
|---|
onChange | (value: string, e: ChangeEvent<HTMLTextAreaElement>) => voidCallback fired when the textarea value changes. |
|---|
changeAction | (value: string, e: ChangeEvent<HTMLTextAreaElement>) => void | Promise<void>Async action fired after onChange inside a React transition. Enables optimistic updates via useOptimistic. |
|---|
isLabelHidden | boolean · default falseVisually hides the label while keeping it accessible to screen readers. |
|---|
description | stringHelper text displayed between the label and textarea. |
|---|
isOptional | boolean · default falseDisplays an "Optional" indicator next to the label. Mutually exclusive with isRequired. |
|---|
isRequired | boolean · default falseDisplays a "Required" indicator next to the label and sets aria-required. Mutually exclusive with isOptional. |
|---|
isDisabled | boolean · default falseDisables the textarea, preventing interaction. |
|---|
isReadOnly | boolean · default falseMakes the textarea read-only: the value is shown at full opacity and still submits with the form, but cannot be edited. Unlike isDisabled, a read-only textarea is not dimmed and stays in the tab order. isDisabled takes precedence when both are set. |
|---|
disabledMessage | stringExplains why the textarea is disabled. With isDisabled, shows a tooltip on hover/keyboard focus and keeps the textarea focusable via aria-disabled (the field becomes read-only). Use this instead of wrapping a disabled TextArea in Tooltip. Disabled controls swallow the hover events an external Tooltip needs. |
|---|
isLoading | boolean · default falsePuts the textarea in a loading state, showing a spinner inside the input. |
|---|
placeholder | stringPlaceholder text shown when the textarea is empty. |
|---|
rows | number · default 3Number of visible text rows. |
|---|
maxLength | numberMaximum number of characters allowed, counted as user-perceived characters: an emoji or flag sequence counts as one. When set, a character counter (current/max) is displayed inside the input container, anchored to the bottom-right beneath the text. Does not enforce the limit natively; when exceeded the counter turns red and shows a warning icon (a non-color cue), and screen-reader users hear the remaining/over-limit count announced. Consumers validating the limit should count with characterCount (exported from the package) so enforcement matches the displayed count. |
|---|
status | { type: 'warning' | 'error' | 'success'; message?: string }Status indicator that applies a colored border and icon. An optional message is displayed in a floating box below the textarea. |
|---|
statusVariant | 'attached' | 'detached' | 'tooltip' · default 'attached'How the status message is placed relative to the input. attached overlaps directly below the input (bordered treatment); detached floats below as a separate element with spacing; tooltip hides the message box and surfaces it in a tooltip on the status icon. |
|---|
labelTooltip | stringTooltip text displayed in an info icon at the end of the label. |
|---|
startIcon | IconTypeIcon component rendered inside the leading edge of the textarea wrapper. See astryx docs icons for valid semantic names. |
|---|
hasSpellCheck | boolean · default trueEnables or disables browser spell checking. |
|---|
hasAutoFocus | boolean · default falseAutomatically focuses the textarea on mount. |
|---|
size | 'sm' | 'md' | 'lg' · default 'md'Size of the textarea, affecting internal padding. Height is controlled by rows, not size. |
|---|
onPaste | (e: ClipboardEvent<HTMLTextAreaElement>) => voidCallback fired when content is pasted into the textarea. |
|---|
htmlName | stringHTML name attribute for the textarea element, useful for form submissions. |
|---|
width | SizeValueWidth of the field (number = pixels, string used as-is, e.g. "100%"). Sizes the whole field (label, control, and status) so they stay aligned. |
|---|
onFocus | (e: FocusEvent<HTMLTextAreaElement>) => voidCallback fired when the textarea receives focus. |
|---|
onBlur | (e: FocusEvent<HTMLTextAreaElement>) => voidCallback fired when the textarea loses focus. |
|---|
autoComplete | stringThe native autocomplete attribute, forwarded to the textarea unchanged. Does not affect the controlled value. |
|---|
xstyle | StyleXStylesStyleX styles for layout customization (margins, positioning, sizing). Must be a stylex.create() value, not an inline style object like style={{}}. |
|---|