Skip to content

Textarea ​

Multi-line text field; choose it for free text longer than one line (notes, descriptions, messages). Use input for a single line.

Usage ​

vue
<Label for="notes">Notes</Label>
<Textarea id="notes" v-model="notes" rows="4" />

Props ​

PropTypeDefaultNotes
modelValuestring''v-model
size'md' | 'sm' | 'lg''md'
invalidbooleanfalseSets aria-invalid and the danger border
autoresizebooleanfalseGrows with its content; cap it with a max-h-* class
disabledbooleanfalse
classstringnoneMerged last

Native attributes (rows, placeholder, readonly, maxlength, required, name, id) fall through to the textarea.

Without autoresize, rows sets the height and the reader can drag it taller. With autoresize, the field starts one line tall (or as tall as a placeholder that wraps) and grows line by line, where the browser supports field-sizing; rows is then ignored, so set a starting height with a min-h-* class. Where field-sizing isn't supported, the field keeps its rows height, scrolls, and stays resizable.

size sets the padding and text size; the height comes from rows or the content, so an empty sm field is not shorter than md.

Slots ​

None.

Events ​

EventPayloadWhen
update:modelValuestringOn input

Native focus, blur, and keydown pass through.

Tokens ​

TokenFalls back toControls
--h-input-radius--h-radius-mdCorner radius, shared with input so fields match

States ​

default, hover, focus-visible, filled, placeholder, disabled, readonly, invalid; three sizes; autoresize empty and after several lines.

Keyboard ​

Native textarea behavior: Enter adds a line. No custom keys.

Accessibility ​

  • The component renders no label. Pair it with label by id, or let form wire it.
  • Placeholder text uses subtle-foreground and never replaces a label.
  • invalid sets aria-invalid="true"; describe the error with aria-describedby.

Do ​

vue
<Label for="message">Message</Label>
<Textarea id="message" v-model="message" autoresize class="max-h-60" />

Do not ​

vue
<!-- Enter submits a form here only by your own handler; never for a
     textarea that users expect to break lines. -->
<Textarea v-model="message" @keydown.enter.prevent="send" />