PeakUI

TextArea

Multiline text input

Usage

import {TextArea} from "@peakui/react";

Examples

Variants

Full Width

In A Text Field

A TextArea inside a TextField inherits its variant.

Customization

Tailwind CSS

<TextArea className="min-h-40" aria-label="Description" />

Global CSS

.textarea {
  min-height: 6rem;
}

Styling Reference

CSS Classes

ClassDescription
.textareaThe textarea element
.textarea--primary, .textarea--secondaryVariant modifiers
.textarea--full-widthFull-width modifier

Slots

SlotDescription
[data-slot="textarea"]The textarea element

Interactive States

The component supports both CSS pseudo-classes and data attributes:

StateAttribute
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)

API Reference

TextArea.Root

PropTypeDefaultDescription
variant"primary" | "secondary""primary"Visual variant; inherited from the owning TextField when unset
fullWidthbooleanfalseStretches to the container width
valuestring-Controlled value
defaultValuestring-Uncontrolled initial value
isDisabledboolean-Disables the textarea
isReadOnlyboolean-Makes the textarea read-only
isRequiredboolean-Marks the textarea required
rowsnumber-Visible row count
onChange(event) => void-Native change handler; read the value from event.target.value
...restEvery React Aria TextArea attribute is accepted

On this page