TextArea
A labelled text field of several lines, with a hint, an error and an optional character count.
Stability: experimental
Props
| Prop | Type | Default | Means |
|---|---|---|---|
label | string | The label and accessible name. | |
value | string | bindable("") | The text. Bind it with bind:value={name}. |
placeholder | string | Hint text while empty. | |
hint | string | Help under the field. | |
error | string | An error under the field. | |
rows | number | 4 | Lines tall before it scrolls. |
limit | number | Shows a count such as 25 / 60, red once past the limit. | |
disabled | boolean | false | Cannot be edited or focused. |
States
| State | Looks like |
|---|---|
focused | Primary border and ring. |
error | Danger border; the error text. |
over limit | Danger border and a red count. |
disabled | 50% opacity. |
Accessibility
| role | textbox (multi-line) |
| name | The label prop. |
| focus | Tab reaches it; Shift+Tab leaves it. A disabled one is skipped. |
| notes | error or an exceeded limit sets aria-invalid. The field is described (aria-describedby) by the error when there is one, otherwise by the hint. |
Theme tokens
color.surface color.border color.primary color.danger color.ink color.muted radius.md text.label text.caption
Example
<TextArea label="Bio" limit={160} bind:value={bio} />