Textarea

A multi-line text input with optional auto-resize.

Import

import { Textarea } from '@matix/components/textarea';

Usage

Auto Resize

When autoResize is enabled the textarea grows with its content using CSS field-sizing.

<Textarea autoResize aria-label="Notes" placeholder="Start typing — I'll grow…" />

Invalid State

<Textarea invalid aria-label="Comment" placeholder="Something went wrong" />

With Field

Wrap in a Field for label, description, and error display.

<Field label="Bio" description="Tell us about yourself.">
  <Textarea autoResize placeholder="I enjoy…" />
</Field>

Disabled

<Textarea disabled aria-label="Disabled textarea" placeholder="Disabled textarea" />

Custom Styles

import * as stylex from '@stylexjs/stylex';

const custom = stylex.create({
  tall: { minHeight: '160px', borderRadius: '12px' },
});

<Textarea sx={custom.tall} aria-label="Tall textarea" placeholder="Tall textarea" />;

API Reference

PropTypeDefaultDescription
autoResizebooleanfalseGrow height with content via CSS field-sizing
invalidbooleanfalseShow invalid styling
sxStyleXStyles—StyleX style override

All other props are forwarded to the underlying <textarea> element.

Accessibility

  • Renders a native <textarea> element — full screen reader support out of the box.
  • Focus ring via :focus-visible — no JS.
  • Invalid state applies a red border. Pair with Field to surface error messages to assistive technology.

Keyboard

KeyAction
TabMoves focus into / out of the textarea