Textarea
Token-styled multiline text input.
Preview
A live, theme-aware example rendered with the published component.
Loading preview…
Import
Import the component from its dedicated entry point to keep the dependency and generated bundle explicit.
tsximport { Textarea } from "@tavojs/ui/textarea";Normal Tavo.js applications load component styles through the Tavo.js UI plugin. If the application manages component CSS manually, also import @tavojs/ui/css/textarea.
When to use
Use it when
Choose something else when
Examples
Textarea example
tsximport { Textarea } from "@tavojs/ui/textarea";
export function TextareaExample1() {
return (
<>
<Textarea rows={6} resize="vertical" />
</>
);
}Common props and defaults
| Prop | Type | Default | Description |
|---|---|---|---|
className | string | — | Optional class hook applied to the public root element owned by the component. |
resize | "none" | "vertical" | "horizontal" | "both" | — | Configures resize for this component. |
rows | number | — | Configures rows for this component. |
Complete TypeScript API
Import from @tavojs/ui/textarea. Published exports: Textarea, TextareaProps.
TextareaProps
| Property | Type | Required | Description |
|---|---|---|---|
className | string | No | Optional class hook applied to the public root element owned by the component. |
resize | "none" | "horizontal" | "vertical" | "both" | No | Configures resize for this component. |
rows | number | No | Configures rows for this component. |
onChange | ValueChangeHandler<HTMLTextAreaElement> | No | Inherited onChange attribute accepted by Textarea. |
onInput | ValueChangeHandler<HTMLTextAreaElement> | No | Inherited onInput attribute accepted by Textarea. |
State ownership and DOM target
| Concern | Contract |
|---|---|
| State | No component state contract is exposed; the application owns the rendered content and surrounding behavior. |
| DOM target | Native input attributes target the owned form control; wrapper-specific props stay on the documented component root. |
Anatomy and related components
Limitations
Avoid Textarea when wrapping controls without labels or accessible names.
Use only the documented props, entry points, and compound members. Internal DOM nesting and CSS class names can change without becoming part of the public component contract.
Accessibility
Form components pass through native attributes and should be paired with visible labels or accessible names.
Use Field, FormLabel, FormControlLabel, or aria-label for labeling.
Preserve native input semantics whenever possible.
Expose validation with error text and aria-invalid where relevant.
Component status
| Contract | Current value |
|---|---|
| Maturity | stable |
| Category | forms |
| Component import | @tavojs/ui/textarea |
| Explicit CSS import | @tavojs/ui/css/textarea |
| Preview | Interactive preview available on this page |