Textarea
Collects text that runs to more than one line.
Configurations
Supported configurations for this component.
States
Interaction states covered by the API and the style contract.
Configurations
2 examplesStates
5 examplesAdd to your project
One command adds this component to your project.
Run the following command. New project? Run npx shadcn@latest init first to set up Tailwind and path aliases.
npx shadcn@latest add @aicanvas/••••••••••••Light and dark both come with the install and follow the dark class on <html>, the shadcn dark mode setup (next-themes with attribute="class").
Props
Every prop this component accepts. Any other prop is forwarded to the underlying element.
| Prop | Type | Default | Description |
|---|---|---|---|
| label | string | - | Label rendered above the field and linked to it. |
| size | 'sm'|'md'|'lg' | 'md' | Rung on the shared control ladder. Sets padding and text size to match an Input of the same size; the height still comes from `rows`. |
| error | string | - | When set, switches the field into the error state. |
| rows | number | 4 | Number of visible text lines; sets the field's initial height. |
| className | string | - | Forwarded to the <textarea>. |
| wrapperClassName | string | - | Forwarded to the outer wrapper. |