import { TextArea } from "@senvenli/react/form";
export default function Example() {
return (
<TextArea
label="Notes for the customer"
placeholder="Payment terms, delivery details…"
description="Shown at the bottom of the invoice."
isOptional
/>
);
}import { TextArea } from "@senvenli/react/form";Examples
With a limit
`maxLength` shows the count; text past it is kept and marks the field invalid.import { TextArea } from "@senvenli/react/form";
export default function Example() {
return (
<TextArea
label="Project summary"
maxLength={160}
defaultValue="A new storefront for the spring catalog, with faster checkout and saved carts."
/>
);
}Invalid
The error says what is missing.import { TextArea } from "@senvenli/react/form";
export default function Example() {
return (
<TextArea
label="Reason for the refund"
defaultValue="Late"
isInvalid
errorMessage="Describe what happened in a sentence or two, so finance can approve it."
/>
);
}Guidelines
When to use it
- Longer free text: a message, notes, a description.
Use something else when
- The answer fits on one line. Input
Accessibility
Built in
- The character count is announced politely as it changes.
- Required fields show "Fill in this field." after a blur or a submit; your own
errorMessagereplaces it.
You provide
- A visible label.
API reference
TextArea
| Prop | Type | Default | Description |
|---|---|---|---|
labelRequired | React.ReactNode | – | |
isLabelHidden | boolean | – | Keeps the label for screen readers only: it still names the field, but takes no space. For a field whose purpose the surface already shows, such as a chat reply box under its conversation. A visible label stays the default. |
description | React.ReactNode | – | |
errorMessage | React.ReactNode | – | |
isOptional | boolean | – | |
placeholder | string | – | |
maxLength | number | – | Shows the counter. The user may type or paste past it; the field turns invalid and blocks on submit, so pasted text is never cut silently. |
showCounter | boolean | – | Shows the "89 / 500" count under the field; |
requiredValidation | RequiredValidation | – | Who says an empty required field is missing: |
radius | ComponentRadius | – | Corner radius: |
labelRequiredReact.ReactNodeisLabelHiddenbooleanKeeps the label for screen readers only: it still names the field, but takes no space. For a field whose purpose the surface already shows, such as a chat reply box under its conversation. A visible label stays the default.
descriptionReact.ReactNodeerrorMessageReact.ReactNodeisOptionalbooleanplaceholderstringmaxLengthnumberShows the counter. The user may type or paste past it; the field turns invalid and blocks on submit, so pasted text is never cut silently.
showCounterbooleanShows the "89 / 500" count under the field;
trueby default whenevermaxLengthis set.falsehides only the visible count: the limit still marks the field invalid pastmaxLength, and screen readers still hear when it is exceeded.requiredValidationRequiredValidationWho says an empty required field is missing:
field(default) orapp. Withappa DS Form'sonSubmitruns with the field empty, and the app's own error must clear on change. See {@link RequiredValidation} for the whole contract.radiusComponentRadiusCorner radius:
none,small,medium(the design),largeorfull. The provider's default otherwise.