videorc/ui

Textarea

A multi-line text field that grows with its content, at 14 px on the chip radius. Inside a Field, its label names it and its descriptions describe it.

Shown under the livestream on YouTube.

Installation

$ pnpm dlx shadcn@latest add @videorc/textarea

Usage

import { Textarea } from "@/components/ui/textarea";
<Field>
  <FieldLabel>Description</FieldLabel>
  <Textarea placeholder="Optional" />
</Field>

Examples

States

Set aria-invalid and put a FieldError under it when its text is refused. A disabled textarea inside a Field says why in its description.

Locked while you're recording or live.

Theming

Token or attributeMeaning
field-sizing-contentGrows with its text, from a 64 px minimum
rounded-chipThe 6 px control radius
bg-input/50The recessed field fill
text-sm14 px at every width
aria-invalidDraws the destructive border and ring
data-slot="textarea"The textarea, for styling from a parent

It doesn't resize by hand. Pass resize-y and a taller min-h-* for a long description.

Accessibility

Inside a Field, the FieldLabel names the textarea and every FieldDescription describes it. Outside one, pass aria-label, or a Label with htmlFor. An explicit id or aria-describedby always wins.

API reference

Every <textarea> attribute, plus:

Prop

Type