Skip to main content

Textarea

Multi-line text input styled automatically by @primus/ui-core.

Preview ยท Textarea

Codeโ€‹

<div class="vstack" style="max-width:340px">
<label>Notes <textarea rows="4" placeholder="Add notes about this tenant..."></textarea></label>
<div data-field="error">
<label>Description <textarea rows="3" aria-invalid="true"></textarea></label>
<span class="error">Description is required.</span>
</div>
</div>

Propsโ€‹

PropTypeDefaultDescription
labelstringโ€”Label text
rowsnumber3Visible rows
errorstringโ€”Error message
disabledbooleanfalseDisabled

Accessibilityโ€‹

  • Always associate a <label> โ€” do not use placeholder as the only label
  • maxlength attribute is announced by some screen readers; pair with a visible character count
  • Error state sets aria-invalid="true" and links error text via aria-describedby
  • Resize handle is keyboard-accessible in modern browsers
Version history

See the Changelog for version history and breaking changes.