Components
- Accordion
- Alert
- Alert Dialog
- Aspect Ratio
- Attachment
- Autocomplete
- Avatar
- Badge
- Breadcrumb
- Bubble
- Button
- Calendar
- Card
- Carousel
- Chart
- Checkbox
- Checkbox Group
- Collapsible
- Combobox
- Command
- Context Menu
- Date Picker
- Dialog
- Drawer
- Dropdown Menu
- Empty
- Field
- Fieldset
- Form
- Frame
- Group
- Input
- Input Group
- Kbd
- Label
- Menu
- Menubar
- Message
- Meter
- Number Field
- OTP Field
- Pagination
- Popover
- Preview Card
- Progress
- Questionnaire
- Radio Group
- Scroll Area
- Select
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Spinner
- Switch
- Table
- Tabs
- Textarea
- Toggle
- Toggle Group
- Toolbar
- Tooltip
Shared
- Artifact
- Audio Player
- Canvas
- Chain of Thought
- Checkpoint
- Code Block
- Commit
- Connection
- Context
- Controls
- Edge
- Environment Variables
- Mic Selector
- Model Selector
- Node
- Node Toolbar
- Open in Chat
- Panel
- Plan
- Prompt Input
- Queue
- Reasoning
- Sandbox
- Schema Display
- Shimmer
- Snippet
- Sources
- Speech Input
- Stack Trace
- Suggestion
- Tool
- Transcription
- Web Preview
Hooks
Resources
Textarea
A native textarea element.
import { Textarea } from "@/components/ui/textarea";
export default function Particle() {
return <Textarea placeholder="Type your message here" />;
}
Installation
pnpm dlx shadcn@latest add @frontal-labs/textarea
Usage
import { Textarea } from "@/components/ui/textarea";<Textarea />Field Integration
Base UI does not provide a Textarea primitive, so this component renders a plain native <textarea>. It sits inside Field like any other control.
<Field>
<FieldLabel>Bio</FieldLabel>
<Textarea placeholder="Tell us about yourself…" />
<FieldDescription>Write a short bio.</FieldDescription>
<FieldError>This field is required.</FieldError>
</Field>API Reference
Textarea
Styled native textarea element. All standard textarea attributes are supported and forwarded to the underlying element. Height grows with the content via field-sizing-content, from a min-h-16 floor.
In light mode the field carries a bg-muted fill on top of its border, so an empty textarea stays visible against a white surface instead of relying on the border alone. Disabled textareas switch to bg-input/50.
Examples
Disabled
import { Textarea } from "@/components/ui/textarea";
export default function Particle() {
return <Textarea disabled placeholder="Can't type here" />;
}
With Label
import { useId } from "react";
import { Label } from "@/components/ui/label";
import { Textarea } from "@/components/ui/textarea";
export default function Particle() {
const id = useId();
return (
<div className="flex flex-col items-start gap-2">
<Label htmlFor={id}>Message</Label>
<Textarea id={id} placeholder="Type your message here" />
</div>
);
}
Form Integration
"use client";
import type { FormEvent } from "react";
import { useState } from "react";
import { Button } from "@/components/ui/button";
import { Field, FieldError, FieldLabel } from "@/components/ui/field";
import { Spinner } from "@/components/ui/spinner";
import { Textarea } from "@/components/ui/textarea";
export default function Particle() {
const [loading, setLoading] = useState(false);
const onSubmit = async (e: FormEvent<HTMLFormElement>) => {
e.preventDefault();
const formData = new FormData(e.currentTarget);
setLoading(true);
await new Promise((r) => setTimeout(r, 800));
setLoading(false);
alert(`Message: ${formData.get("message") || ""}`);
};
return (
<form className="flex w-full max-w-64 flex-col gap-4" onSubmit={onSubmit}>
<Field>
<FieldLabel>Message</FieldLabel>
<Textarea name="message" placeholder="Type your message here" required />
<FieldError>This field is required.</FieldError>
</Field>
<Button disabled={loading} type="submit">
{loading && <Spinner />}
Submit
</Button>
</form>
);
}