qds-textarea provides multiline plain-text entry with native form association, validation, a character counter, and optional autosizing. Load assets/components/textarea/qds-textarea.js independently. Use qds-rich-text-editor when formatting is part of the value.
<qds-textarea name="notes" label="Notes" rows="4" hint="Plain text only"></qds-textarea>
<qds-textarea label="Summary" required minlength="10" maxlength="500" show-counter></qds-textarea>
<qds-textarea label="Growing notes" autosize rows="2" max-rows="8"></qds-textarea>
<qds-textarea label="Reference" readonly value="Existing reference"></qds-textarea>
label is a native label. hint and displayed errors/counters are associated with the textarea. aria-label or a host aria-labelledby can supply an external accessible name; the latter copies referenced label text across the shadow boundary when attributes synchronize. Keep the referenced label text stable, or reassign aria-labelledby after changing it. Placeholder text is an example, not a label replacement.
The hint/error area reserves one line and the height of either current message, including wrapped text. Hidden messages remain inaccessible; revealing an error on blur does not move the next action during a pointer click.
The value property is the current text. The value attribute and defaultValue property set the reset default. Changing the default does not replace a dirty current value. form.reset() restores the default without emitting user events. State restoration restores the current text. Programmatic values are never interpreted as HTML and never silently truncated.
name, native form association (including the form attribute), disabled fieldsets, disabled, and readonly follow native form behavior. Disabled controls are excluded from submission; readonly values are submitted. required, minlength, maxlength, invalid, and setCustomValidity(message) participate in validity. Empty optional text is valid. maxlength limits native typing; an oversized programmatic value remains visible and reports tooLong. minlength also validates programmatic nonempty values.
Call checkValidity() or reportValidity() and inspect validity/validationMessage. validate-on="blur|input|submit" controls error display, not whether invalid values block submission. error-text overrides built-in messages. Custom validity persists until explicitly cleared with setCustomValidity(''), including across reset, matching native controls.
User edits emit bubbling/composed input; the native commit emits change. Both carry { component, value }. Programmatic assignments, reset, and state restoration emit no input/change. Validity transitions emit qds-validity-change with { component, valid, validity, message }.
rows defaults to 3. autosize grows and shrinks with content and width changes; max-rows defaults to 12 and cannot be smaller than rows. At the limit, the text area scrolls. Autosizing disables manual resizing. Otherwise resize="none|vertical|horizontal|both" defaults to vertical. show-counter displays length with the maximum when supplied. size="sm|md|lg", semantic light/dark tokens, a 44px minimum height, focus outlines, forced colors and reduced motion follow QDS conventions.
CSS parts: container, label, input, hint, error, counter. Interactive demonstration covers major states and real form submission/reset.