ComponentsFields & validation
Textarea
Shared primitiveEnter plain multiline content.
@/components/ui/textarea
Composition preview
Try Textarea alongside its related fields & validation components. These examples keep all actions local.
Usage
import { Field, FieldLabel } from "@/components/ui/field";
import { Textarea } from "@/components/ui/textarea";
<>
<Field>
<FieldLabel htmlFor="notes">Notes</FieldLabel>
<Textarea id="notes" name="notes" rows={4} />
</Field>
</>Composition recipe. Supply application state, handlers and persistence in the owning product component. Inspect the installed source before extending its API.
API & composition
Native textarea props, rows, value/defaultValue, required, ref
Usage & accessibility
Do not replace the rich-text composer with Textarea. Keep an error description associated.
Implementation contract
src/components/ui/textarea.tsx
Use named variants and semantic theme tokens. Preserve existing input values, refs, focus and cancellation behavior. Verify keyboard, narrow layouts and pending/error states when behavior changes.