Textarea
Several lines of text.
import { Textarea } from '@/design-system';Examples
import { Field, Textarea } from '@/design-system';
export default function TextareaBasic() {
return (
<Field label="Notes (optional)">
<Textarea rows={3} />
</Field>
);
}How it works
- Inside a
Fieldit picks up the field’sid,aria-invalidandaria-describedby. A prop you set yourself wins. - It also works on its own. Then give it a name for screen readers, such as
aria-label. - Set its height with
rows.
Props
Every textarea attribute, including ref, is passed through.
| Prop | Type | Default | Description |
|---|---|---|---|
className | string | — | Extra classes, for spacing or width. Utility classes override the component’s own styles. |
Tokens
| Token | Default | Sets |
|---|---|---|
--field-radius | --radius-control | Corner radius |
--field-background | --surface | Fill |
--field-border | --border | Border colour. An invalid control uses --critical. |
--field-padding-x | 0.75rem | Side padding |
--field-padding-y | 0.5rem | Top and bottom padding |
--field-font-size | 0.875rem | Text size of the field and its control |