Skip to main content
Textareas provide multi-line text input for comments, descriptions, and other longer content.

Basic Usage

With Labels

With Initial Value

Disabled State

Reading the Value

Use .rx to get a reactive reference to the textarea’s current text. The .length() pipe returns the character count, which is useful for showing a live counter: Type into the textarea and the character count updates with each keystroke.

API Reference

Textarea Parameters

placeholder
str | None
default:"None"
Placeholder text shown when the textarea is empty.
value
str | None
default:"None"
Initial value.
name
str | None
default:"None"
State key for the textarea’s current value. Auto-generated if not provided. Use .rx to reference the textarea’s content in other components without specifying the key explicitly.
rows
int | None
default:"None"
Number of visible text rows.
disabled
bool
default:"False"
Whether the textarea is non-interactive.
required
bool
default:"False"
Whether the textarea is required for form submission.
css_class
str | None
default:"None"
Additional Tailwind CSS classes appended to the component’s built-in styles.

Protocol Reference

Textarea
{
  "type": "Textarea",
  "name?": "string",
  "placeholder?": "string",
  "value?": "string",
  "rows?": "number",
  "disabled?": false,
  "required?": false,
  "minLength?": "number",
  "maxLength?": "number",
  "onChange?": "Action | Action[]",
  "cssClass?": "string"
}
For the complete protocol schema, see Textarea.