Textarea Input

Commonly used textarea input component.

Installation

npx wdc add textarea

Examples

Basic Usage

Standard multiline text input.

Validation States

Visual feedback for error and success states.

Message must be at least 10 characters.

Thanks for your feedback!

Disabled

Prevents user interaction.

API Reference

InputTypeDefaultDescription
labelstring''Label displayed above the textarea.
placeholderstring''Placeholder text.
rowsnumber3Number of visible text lines.
errorstring | nullnullError message text. Changes border to red.
successbooleanfalseIf true, changes border to green.
hintstring | nullnullHelper text displayed below the textarea.
check_circle
SEO & Accessibility

This component uses the following:

  • Association: The component generates a unique ID (wdc-textarea-1) and links the <label> via for and the error message via aria-describedby. This ensures screen readers announce "Label, Invalid entry: Error message" seamlessly.
  • Resizing: The default behavior allows vertical resizing (browser default). You can disable this via class if needed (class="resize-none").

Check out Google Search Central for more details.