Textarea
Enter and edit multiline text.
Shown on the project overview.
Installation
pnpm dlx shadcn@4.18.0 add @siteplane/textareaComplete the one-time setup first. Registry JSON lists source files and dependencies.
For this page’s examples, also install:
pnpm dlx shadcn@4.18.0 add @siteplane/inputField is installed with Input.
Usage
import { Textarea } from "@/siteplane/components/textarea";
<Textarea aria-label="Description" />;Variants
Choose the control surface without changing its behavior. elevated lifts the field with the hairline and soft shadow of an elevated Card, so it reads on a white surface too.
Height by lines
minLines sets the least height of the textarea and maxLines the most, in text lines plus the padding of the size. Both take fractions, such as 2.5 lines for a description. In between, the textarea grows with its content; past maxLines its text scrolls.
The customer gets your reply by email.
Sizes
Omit size to inherit the provider's control size. Each size sets its own minimum height. The text is 14px, or 16px at xl; textSize sets it at any size. Touch screens always use 16px text.
Disabled, read-only and invalid
disabled blocks editing; readOnly keeps the value focusable and submitted. Set invalid on Field and explain the problem with FieldError.
Character limit
Control the value with value and onChange to show the remaining characters. maxLength enforces the limit.
280 characters left
API reference
| Prop | Type | Default | Description |
|---|---|---|---|
size | sm | md | lg | xl | provider / lg | Visual control size. |
text | sm | base | unset | Text size at any control size: sm is 14px, base is 16px. Unset uses 14px, or 16px at xl; touch screens use 16px. |
min | number | unset | Least height in text lines, fractions allowed, plus the padding of the size. Replaces the minimum height of the size; the textarea still grows with its content. |
max | number | unset | Most height in text lines, fractions allowed, plus the padding of the size. The textarea grows up to it, then scrolls; unset, it grows without a limit. minLines wins where the two disagree. |
variant | default | elevated | inset | default | Surface treatment. |
unstyled | boolean | false | Removes the outer surface recipe; preserves control anatomy. |
class | string | unset | Styles the outer span, not the native control. |
TextareaProps and TextareaProfile export the types above. FieldPrimitive is also exported. Native textarea props, including required, name, value, defaultValue, readOnly, onChange and ref, reach the actual textarea through Field Control. There is no onValueChange prop. Because the textarea sizes to its content, the native rows does not set its height: use minLines and maxLines.
Other native attributes follow HTML textarea.
Usage notes
Always provide a visible label or an accessible name. Placeholder text is not a label. Use Field for related help and errors. Where the browser supports field-sizing: content, the textarea grows with its content and shows no resize grip; in other browsers it keeps its height and a vertical resize grip. There is no autoGrow prop. The control does not persist data or implement request loading. A plain native form and the kit Form have different validation presentation; see Forms.