Text Area

A flexible writing field for notes, prompts, and support flows.

Loading preview...

Examples

Practical examples and common states for the same installable component.

Auto Grow

Grow with content until the configured maximum row count.

examples/text-area-auto-grow.tsx
"use client";
import * as React from "react";
import { Textarea } from "@/components/wensity/text-area";
export function TextareaAutoGrow() {
const [value, setValue] = React.useState(
"Auto-grow keeps short notes compact, then expands until the configured maximum row count.",
);
return (
<Textarea
label="Brief"
value={value}
onChange={(event) => setValue(event.target.value)}
autoResize
minRows={3}
maxRows={8}
hint="Try adding more lines; the field grows without layout jumps."
/>
);
}

Filled

Soft filled surface for dense product panels and notes.

examples/text-area-filled.tsx
import { Textarea } from "@/components/wensity/text-area";
export function TextareaFilled() {
return (
<Textarea
variant="filled"
label="Internal note"
defaultValue="The customer asked for workspace-level permissions before inviting the rest of the team."
hint="Only visible to admins."
minRows={4}
/>
);
}

Ghost

Quiet editor field for composer surfaces.

examples/text-area-ghost.tsx
"use client";
import * as React from "react";
import { Textarea } from "@/components/wensity/text-area";
export function TextareaGhost() {
const [value, setValue] = React.useState(
"Turn this release summary into a short changelog for the customer portal.",
);
return (
<Textarea
aria-label="AI prompt"
variant="ghost"
value={value}
onChange={(event) => setValue(event.target.value)}
showCount
maxLength={180}
minRows={4}
resize="none"
/>
);
}

Error

Validation updates border, focus ring, and aria-invalid.

examples/text-area-error.tsx
import { Textarea } from "@/components/wensity/text-area";
export function TextareaError() {
return (
<Textarea
label="Reproduction steps"
defaultValue="It broke."
error="Add at least two clear steps so the team can reproduce it."
minRows={4}
/>
);
}

Character Count

Count text is connected to aria-describedby automatically.

examples/text-area-character-count.tsx
"use client";
import * as React from "react";
import { Textarea } from "@/components/wensity/text-area";
export function TextareaCharacterCount() {
const [value, setValue] = React.useState(
"A compact component library for shipping premium app interfaces faster.",
);
return (
<Textarea
label="Short bio"
value={value}
onChange={(event) => setValue(event.target.value)}
maxLength={110}
showCount
minRows={3}
resize="none"
hint="Keep it direct and useful."
/>
);
}

Read-only

Read-only values stay selectable while reducing emphasis.

examples/text-area-readonly.tsx
import { Textarea } from "@/components/wensity/text-area";
export function TextareaReadonly() {
return (
<Textarea
label="Generated summary"
value="The workspace billing role changed from Member to Admin on June 16, 2026."
readOnly
minRows={3}
resize="none"
/>
);
}

Disabled

Disabled text areas block interaction while keeping layout stable.

examples/text-area-disabled.tsx
import { Textarea } from "@/components/wensity/text-area";
export function TextareaDisabled() {
return (
<Textarea
label="Cancellation reason"
defaultValue="Workspace was archived by an organization owner."
disabled
minRows={3}
resize="none"
/>
);
}