TextArea
TextArea is the multi-line text field, a native <textarea> with the input size and state tokens. With maxLength
it shows a remaining-characters counter, controlled or not.Forms
When to use
Use when
- Collecting comments, descriptions or messages that may span several lines.
- An editor should take the full height of its pane (
fill).
Avoid when
- The value fits on one line — use
Input. - The value has a fixed format (date, money, phone) — use
InputDate,InputCurrencyorInputMask.
Usage
140 characters left
<TextArea aria-label="Comment" placeholder="Leave a comment" maxLength={140} />maxLengthHint sets the counter suffix (default characters left). resize enables the manual resize handle. As on
Input, a native constraint paints the error border after interaction (:user-invalid) unless
you pass an explicit variant.
Auto-resize
autoResize grows the field with its content, from rows up to an optional maxRows. It uses
field-sizing: content; browsers without it keep the rows height. It turns resize off.
<TextArea aria-label="Description" rows={2} autoResize maxRows={6} />Fill
fill makes the field take the leftover height of its flex parent, with rows as the minimum. Inside a
Field, pass it through inputProps: label and hint keep their height. Every ancestor up
to the sized pane must be a flex container. fill wins over autoResize (with a development warning) and turns
resize off.
2000 characters left
<Flex height="100dvh">
<Field component={TextArea} name="content" label="Content" inputProps={{ fill: true, rows: 4 }} />
</Flex>Accessibility
TextArearenders no label: useFieldor passaria-label.- The counter is visible text only; it is not announced as the user types.
Properties
Name
Type
Default
Description
autoResizebooleanfalseWhen `true`, the `<textarea>` grows and shrinks with its content
instead of staying at a fixed `rows` height (`field-sizing: content`).
`min-block-size` is derived from
`rows` (native default `2`) so the field never renders shorter than
before opting in; pair with `maxRows` to cap growth.
Always forces `resize: none` — a manual resize handle would fight the
automatic height on every keystroke, so `autoResize` wins over
`resize` whenever both are set.
Where supported (Chrome 123+, Safari 26.2+, Firefox 152+); elsewhere
keeps the fixed `rows` height. No JavaScript fallback.
Ignored when `fill` is set (see {@link fill}).
fillbooleanfalseWhen `true`, the field fills the leftover space of its flex parent
instead of staying at the `rows` height — e.g. the content editor of a
pane locked to the viewport height. The parent must be a flex container
with a definite size (a `Flex` column with a `height`); inside `Field`
(`inputProps={{ fill: true }}`) the whole field — label, control and
hint — joins the parent's flex layout, and only the control grows.
`rows` (native default `2`) becomes the minimum height, so the field
never renders shorter than without `fill`; a parent shorter than that
overflows rather than squeezing the field. The `maxLength` counter
stays out of the flex math.
Container-sized, so it wins over the content-sized `autoResize` (which
is ignored, with a development warning) and forces `resize: none`.
maxLengthnumbernoneLimits the number of characters and displays a counter in the bottom
right corner with the remaining number.
maxLengthHintstring'characters left'Counter suffix displayed after the number of remaining characters.
maxRowsnumbernoneCaps how many rows `autoResize` may grow to before scrolling instead of
growing further (`max-block-size`). Ignored when `autoResize` is not
set; `0` means no cap.
onChange((e: ChangeEvent<HTMLTextAreaElement, Element>) => void)noneresizebooleanfalseWhen `true`, allows the user to resize the `<textarea>`
(`resize: both`); when `false`, fixes the size.
Ignored when `autoResize` or `fill` is `true` — both always win and
force `resize: none` (see {@link autoResize}, {@link fill}).
size"expansive""medium""compact""micro"'medium'Textarea size token.
valuestringnonevariant"default""success""error"'default'Textarea visual variant.