Components
Textarea
Auto-sizing multiline text input with filled and outline variants, four corner shapes, three sizes, and Field integration.
import { Textarea } from "@/components/ui/textarea";
export default function Particle() {
return <Textarea placeholder="Write your message..." />;
}
Installation
pnpm dlx shadcn@latest add @taut-ui/textarea
Usage
import { Textarea } from "@/components/ui/textarea"<Textarea placeholder="Write your message..." />Examples
Outline
import { Textarea } from "@/components/ui/textarea";
export default function Particle() {
return <Textarea placeholder="Add release notes..." variant="outline" />;
}
Small
import { Textarea } from "@/components/ui/textarea";
export default function Particle() {
return <Textarea placeholder="Compact note..." size="sm" />;
}
Large
import { Textarea } from "@/components/ui/textarea";
export default function Particle() {
return <Textarea placeholder="Detailed feedback..." size="lg" />;
}
With Field & Counter
44 / 160 characters
"use client";
import { useState } from "react";
import {
Field,
FieldDescription,
FieldLabel,
} from "@/components/ui/field";
import { Textarea } from "@/components/ui/textarea";
const MAX_LENGTH = 160;
export default function Particle() {
const [bio, setBio] = useState(
"Building expressive interfaces with Base UI.",
);
return (
<Field>
<FieldLabel>Public bio</FieldLabel>
<Textarea
maxLength={MAX_LENGTH}
onChange={(event) => setBio(event.target.value)}
placeholder="Tell people a bit about yourself..."
value={bio}
/>
<FieldDescription>
{bio.length} / {MAX_LENGTH} characters
</FieldDescription>
</Field>
);
}
Non-Resizable
import { Textarea } from "@/components/ui/textarea";
export default function Particle() {
return (
<Textarea
placeholder="Auto-grows with content without a resize handle..."
resize="none"
/>
);
}
API Reference
Textarea
Wraps Base UI Field.Control rendering a field-sizing-content <textarea> inside a styled container.
| Prop | Type | Default | Description |
|---|---|---|---|
variant | "filled" | "outline" | "outlined" | "filled" | Tonal filled surface or crisp outlined surface |
shape | "rounded" | "round" | "pill" | "square" | "rounded" | Corner radius preset |
size | "sm" | "default" | "lg" | "default" | Minimum height, padding, and font size |
resize | "none" | "vertical" | "horizontal" | "both" | "vertical" | Controls the browser resize handle behavior |
unstyled | boolean | false | Strips container chrome for custom composition |
className | string | - | Additional CSS classes on the outer container |