Forms
Textarea
Multi-line native textarea that grows with its content.
import { Textarea } from "datui";Playground
<Textarea placeholder="Message" rows={2} grow status="default" />Examples
Auto-grow
Grows until maxHeight, then scrolls.
Accessibility
- A native
<textarea>; labelling andaria-invalidwork as for Input.
API
Textarea
Multi-line native `<textarea>` in a FormField that grows with its content. Controlled (`value` + `onChange(event)`) or uncontrolled; `ref` points at the textarea.
| Prop | Type | Default | Description |
|---|---|---|---|
| after | ReactNode | — | Content after the control, e.g. an icon, clear button or unit. |
| afterAlign | FormFieldSlotAlign | end | Vertical alignment of `after`. |
| align | TextAlign | left | Text alignment. |
| before | ReactNode | — | Content before the control, usually an icon. |
| beforeAlign | FormFieldSlotAlign | "center" | Vertical alignment of `before`. |
| className | string | — | |
| grow | boolean | true | Grow with the content (up to `maxHeight`, then scroll). |
| maxHeight | number | — | Max height in px before the content scrolls. |
| mode | FormFieldMode | "default" | `plain` removes border and background, e.g. for fields inside cells or toolbars. |
| onResize | ((element: HTMLTextAreaElement) => void) | — | Called after an auto-grow changed the textarea height. |
| slotProps | { root?: (FormFieldProps & { ref?: Ref<HTMLDivElement>; }); } | undefined | — | Props for the FormField shell. `className` and `style` also go to the shell. |
| status | FormFieldStatus | "default" | Visual validation state. Pair `error` with `aria-invalid` on the control (FormItem does this). |