form fields
<tc-textarea>
Multi-line form-associated text area with label, helper, error state, and configurable rows and resize behavior.
import
"@ra9/tan-compose-kit/textarea"
Props
| Name | Type | Default | Description |
|---|---|---|---|
value | string | "" | Current value. Two-way synced with the underlying textarea. |
name | string | "" | Field name used when submitted as part of a `<form>`. |
placeholder | string | "" | Placeholder text shown when the textarea is empty. |
label | string | "" | Label rendered above the textarea. |
helper | string | "" | Small helper text below the textarea. |
error | string | "" | Error message; when non-empty paints the textarea invalid. |
rows | number | 4 | Initial visible row count. |
disabled | boolean | false | Disables the textarea; reflects to the host. |
required | boolean | false | Required for form validation; reflects to the host. |
resize | "none" | "vertical" | "horizontal" | "both" | "vertical" | CSS resize behavior passed to the underlying textarea. |
Events
| Event | Detail | When |
|---|---|---|
tc-input | { value: string } | Fires on every keystroke with the latest value. |
CSS variables
| Variable | Default | Description |
|---|---|---|
--tc-input-bg | var(--tc-color-surface, #ffffff) | Background color. |
--tc-input-fg | var(--tc-color-ink, #14171f) | Foreground (text) color. |
--tc-input-border | var(--tc-color-rule-strong, #d9cfb8) | Resting border color. |
--tc-input-border-focus | var(--tc-color-accent, #a16939) | Border color when focused. |
--tc-input-error | var(--tc-color-danger, #b3261e) | Border + text color in the error state. |
--tc-input-helper | var(--tc-color-ink-muted, #6b7280) | Color of the helper text. |
--tc-input-radius | var(--tc-radius-md, 8px) | Corner radius. |
--tc-input-font | var(--tc-font-sans, …) | Font family. |
Examples
Basic usage
Rows + resize
rows sets the initial height. resize controls whether the user can drag the bottom corner — set to "none" to lock the height entirely.
Error state
In a form
Submits under name like a native textarea.
Theming
tc-textarea shares the --tc-input-* token family with the other form fields. Override on a wrapper to re-skin every field at once.
Accessibility
- Renders a real
<textarea>so all native keyboard behavior (Enter for newline, Tab to next field) works. aria-invalidreflects the error state.- The label is a real
<label>so click-to-focus works without extra wiring. requiredis forwarded for native browser validation.