Forms
Textarea
Multi-line text field that starts at about four lines and grows with its content.
- Experimental
- Keyboard not tested yet
- Screen reader not tested yet
Playground
Change the props. The controls come from the documented props.
Anything we should know before the first call?
<Textarea
label="Notes"
name="playground-notes"
hint="Anything we should know before the first call?"
/>States
Every variant in every state, side by side. Hover, pressed and focus are shown statically; the default state is interactive.
Error: Enter a message.
Usage
When to use
Use a textarea for answers that take more than one line: a message, a project brief, feedback.
When not to use
- For short answers such as a name or an email address: use Input.
How it works
It starts at about four lines and grows with its content, so people never scroll inside a small box. Label, hint and error work as in every other field.
Content guidelines
Use the hint to say what a good answer contains: “Goals, timeline, team. A few sentences are enough.” That helps more than a character limit.
Do and don’t
Do
- Say in the hint what a good answer contains.
Don’t
- Don't use it for one-line answers; use Input.
Anatomy
The parts of the component and what each one does, as in the playground above.
- labelAlways visible.
- input-fieldAt least textarea.minHeight, grows with content, resizable.
- error-messageSame treatment as Input.
Examples
Type-checked, and the same code goes into the AI manifest. Import: import { Textarea } from "@/ds";
With hint
What should change, and by when?
Props
Checked against the component's TypeScript type on every build.
| Name | Type | Default | Description |
|---|---|---|---|
| label (required) | string | – | Visible label. |
| hint | string | – | Help text, e.g. what to include. |
| error | string | – | Error message; overrides native validation. |
| optional | boolean | false | Adds “(optional)” to the label. |
| messages | ValidationMessages | – | Texts for native validation inside a Form. |
| …textarea | TextareaHTMLAttributes | – | Native attributes except placeholder. |
Tokens used
Derived from the utility classes in the component's source. Copy a class with one click.
| Token | Tier | Value | Utility |
|---|---|---|---|
| textarea.minHeight | component | 96px | |
| spacing.3 | semantic | 12px |
Accessibility
What is checked automatically on every build, and what a person has tested. Nothing is marked as tested unless it was.
| Check | How | Status |
|---|---|---|
| axe-core rules | Automated on every npm run check, at desktop and mobile width | Runs on every build |
| Keyboard | Automated Playwright test (scripts/keyboard.mjs) | Not tested yet |
| Screen reader | Manual | Not tested yet |
Keyboard
| Key | Action |
|---|---|
| Tab | Moves focus into the field. |
Semantics and focus
- Label, hint and error come from Field.
- Grows with the text, so nothing is hidden behind a scrollbar.