import {TextArea} from "@peakui/react";
A TextArea inside a TextField inherits its variant.
<TextArea className="min-h-40" aria-label="Description" />
.textarea {
min-height: 6rem;
}
| Class | Description |
|---|
.textarea | The textarea element |
.textarea--primary, .textarea--secondary | Variant modifiers |
.textarea--full-width | Full-width modifier |
| Slot | Description |
|---|
[data-slot="textarea"] | The textarea element |
The component supports both CSS pseudo-classes and data attributes:
| State | Attribute |
|---|
| Focused | :focus-visible / [data-focus-visible="true"] (from the owning field) |
| Hovered | :hover (from the owning field) |
| Disabled | :disabled |
| Invalid | [data-invalid="true"] (from the owning field) |
| Prop | Type | Default | Description |
|---|
variant | "primary" | "secondary" | "primary" | Visual variant; inherited from the owning TextField when unset |
fullWidth | boolean | false | Stretches to the container width |
value | string | - | Controlled value |
defaultValue | string | - | Uncontrolled initial value |
isDisabled | boolean | - | Disables the textarea |
isReadOnly | boolean | - | Makes the textarea read-only |
isRequired | boolean | - | Marks the textarea required |
rows | number | - | Visible row count |
onChange | (event) => void | - | Native change handler; read the value from event.target.value |
...rest | | | Every React Aria TextArea attribute is accepted |