Textarea
Drag the corner to resize.
Your bio is ready to submit.
A styled, multi-line native <textarea> — user-resizable (vertical), with
the same label, description, error and success wiring as TextField. It
participates in native forms through name. Use this (not TextField) whenever
the input can span multiple lines.
Import
Section titled “Import”<script> import Textarea from "@invisible-ui/svelte/Textarea.svelte";</script><script setup> import { Textarea } from "@invisible-ui/vue";</script>import { Textarea } from "@invisible-ui/react";<script type="module"> import "@invisible-ui/elements/define";</script>
<ds-textarea></ds-textarea>Native constraints
Section titled “Native constraints”maxlength, minlength, autocomplete and spellcheck reach the real
<textarea>, so the browser enforces and reports them itself.
<Textarea label="Message" maxlength={280} minlength={10} />| Prop | Type | Default | Description |
|---|---|---|---|
label * | string | — | Visible label, tied to the control. |
hideLabel | boolean | false | Visually hide the label while keeping it as the accessible name. The label text is always required. |
value | string | "" | Field value. |
placeholder | string | undefined | undefined | Placeholder text. |
rows | number | 3 | Visible text rows. |
description | string | undefined | undefined | Hint shown under the control, linked via aria-describedby. |
error | string | undefined | undefined | When non-empty the field becomes invalid and announces the message. |
success | string | undefined | undefined | Success/validated message; shows a confirming caption. |
disabled | boolean | false | Disable the field. |
required | boolean | false | Mark as required. |
readOnly | boolean | false | Make the field read-only. |
name | string | undefined | undefined | Form field name — the value is submitted under it. |
autocomplete | HTMLTextareaAttributes["autocomplete"] | undefined | undefined | Native textarea autocomplete hint. |
maxlength | number | undefined | undefined | Native length limits; the browser enforces them and reports them. |
minlength | number | undefined | undefined | |
spellcheck | boolean | undefined | undefined | Turn spelling correction off for codes and identifiers. |
onValueChange | ((value: string) => void) | undefined | undefined | Called whenever the value changes. |
| Prop | Type | Default | Description |
|---|---|---|---|
label * | string | — | Visible label, tied to the control. |
hideLabel | boolean | false | Visually hide the label while keeping it as the accessible name. The label text is always required. |
modelValue | string | undefined | v-model value; takes precedence over value when bound. |
value | string | "" | |
placeholder | string | undefined | |
rows | number | 3 | |
description | string | undefined | Optional hint shown under the control and linked via aria-describedby. |
error | string | undefined | Error message; when non-empty the field becomes invalid and announces it. |
success | string | undefined | Success/validated message; shows a confirming caption. |
disabled | boolean | false | |
required | boolean | false | |
readOnly | boolean | false | |
name | string | undefined | Form field name; the value is submitted under it. |
autocomplete | string | undefined | Native textarea autocomplete hint. |
maxlength | number | undefined | Native length limits; the browser enforces them and reports them. |
minlength | number | undefined | |
spellcheck | boolean | undefined | Turn spelling correction off for codes and identifiers. |
onValueChange | (value: string) => void | undefined | Called whenever the value changes. |
| Event | Payload |
|---|---|
update:modelValue | value: string |
| Prop | Type | Default | Description |
|---|---|---|---|
label * | string | — | Visible label and accessible name for the control. |
hideLabel | boolean | false | Visually hide the label while keeping it as the control's accessible name. |
value | string | "" | Initial or current value. |
placeholder | string | — | Native placeholder. It does not replace the label. |
rows | number | 3 | Visible rows. Defaults to 3. |
description | string | — | Hint linked to the control through aria-describedby. |
error | string | — | Error message that marks the control invalid and is announced. |
success | string | — | Confirmation message announced politely when the field is valid. |
disabled | boolean | false | Prevent interaction and form submission. |
required | boolean | false | Mark the native textarea as required. |
readOnly | boolean | false | Keep the textarea focusable and submittable but prevent edits. |
name | string | — | Native form field name: the value is submitted under it. |
autoComplete | TextareaHTMLAttributes<HTMLTextAreaElement>["autoComplete"] | — | Native autofill hint. |
maxLength | number | — | Native maximum length constraint. |
minLength | number | — | Native minimum length constraint. |
spellCheck | boolean | — | Turn spelling correction off for codes and identifiers. |
onValueChange | (value: string) => void | — | Called once after a user edit is committed locally. |
| Attribute | Reactive | Description |
|---|---|---|
label * | yes | |
hide-label | yes | |
value | yes | |
placeholder | yes | |
description | yes | |
error | yes | |
success | yes | |
required | yes | |
disabled | yes | |
readonly | yes | |
name | yes | |
rows | yes | |
autocomplete | yes |
Reactive attributes re-render the element when they change after the first render.
Properties: value.
Emits: bubbling input and change CustomEvents, both with detail.value.
Accessibility
Section titled “Accessibility”- Label association plus
aria-describedby(hint, error and success),aria-invalid,aria-requiredcome from the shared headless text field. - A non-empty
errorputs the field in the invalid state and announces the message. - Error and success messages include a decorative status glyph, so feedback is not conveyed by color alone.
- When both
errorandsuccessare supplied, the error wins.
Example
Section titled “Example”<Textarea label="Message" name="message" autocomplete="off" rows={5} onValueChange={(v) => (message = v)}/>In React, the native attributes take their React spelling (maxLength,
minLength, autoComplete, spellCheck). A form reset restores the current
value without calling onValueChange:
<Textarea label="Message" name="message" rows={5} value={message} onValueChange={setMessage} />Themeable via --ds-field-*.