Skip to content

Text Area

Props ​

PropTypeDefaultDescription
v-modelstring—Required. Text content.
labelstring—Required. Field name.
idstring—Prefix for associated IDs. Auto-generated when omitted.
size'sm' | 'md' | 'lg'mdText area height.
rowsnumber—Native textarea rows.
colsnumber—Native textarea cols.
minlengthnumber | string—Native textarea minlength.
maxlengthnumber | string—Native textarea maxlength.
wrap'soft' | 'hard'softNative textarea wrap.
resize'none' | 'both' | 'horizontal' | 'vertical'verticalNative textarea resize. Vertical dragging is enabled by default.
placeholderstring—Placeholder text.
descriptionstring—Description below the label.
isLabelHiddenbooleanfalseHide the visual label. Keep the accessible name.
isDisabledbooleanfalsePrevent edits. Do not submit the form value.
disabledMessagestring—Reason for disabling. The disabled text area stays focusable when provided.
isReadOnlybooleanfalsePrevent edits. Include the value in form submission.
isRequiredbooleanfalseShow a required description. Does not run native required validation.
isOptionalbooleanfalseShow an optional description. Takes precedence over isRequired.
requiredLabelstringRequiredRequired description text.
optionalLabelstringOptionalOptional description text.
widthnumber | string—Width of the whole field. Numbers are treated as px.
htmlNamestring—Native textarea name.
formstring—ID of the associated form.
statusFieldStatusInput—Error, warning, or success status.
statusVariant'attached' | 'detached' | 'tooltip'detachedHow the status message is displayed. Text area defaults to below the control.
changeAction(value: string, event) => void | Promise<void>—Action to run after content changes.
isLoadingbooleanfalseShow a loading indicator.
hasClearbooleanfalseShow a clear button.
hasAutoFocusbooleanfalseFocus on mount.
clearLabelstring—Accessible label for the clear button.
loadingLabelstringLoadingAccessible label for the loading indicator.
labelIconComponent—Decorative icon before the label.
labelTooltipstring—Info tooltip beside the label.

Events ​

  • update:modelValue(value):update text content.
  • change(value, event):fired when content changes.
  • clear(event):fired when the clear button is clicked.
  • enter(event):fired on Enter. Shift + Enter does not fire it.
  • keydown(event):fired on any key press.
  • actionError(error, value, event):fired when changeAction throws.

When content changes, update:modelValue and change fire before changeAction. Cancelling the change event prevents changeAction from running.

Native attributes ​

  • class, style, and other attributes are applied to the field wrapper.
  • aria-labelledby and aria-describedby are merged into the native textarea.
  • The component manages disabled, readonly, and aria-invalid.
  • The icon slot shows a decorative icon on the left.
  • The end slot shows extra content on the right.
  • The labelIcon slot replaces the icon before the label.

Theming ​

css
.my-text-area {
  --astryx-text-area-min-height-md: 120px;
}
  • --astryx-text-area-min-height-sm: minimum height for the sm size.
  • --astryx-text-area-min-height-md: minimum height for the md size.
  • --astryx-text-area-min-height-lg: minimum height for the lg size.

Other color and border variables are shared with TextInput. Neutral adapts to light and dark modes.