bx

Textarea

Displays a form textarea or a component that looks like a textarea.

tsx
<div className="w-full max-w-md grid gap-2">
  <Label htmlFor="msg">Your message</Label>
  <Textarea id="msg" placeholder="Type your message here..." rows={4} />
</div>

Textarea is a native HTML <textarea> with shadcn styling, for multiline text (message, description, notes). Auto-resize is not included: use rows or CSS.

Installation

Terminal
$ bext ui add textarea

Usage

tsx
import { Textarea, Label } from "@bext-stack/ui/primitives"

<div className="grid gap-2">
  <Label htmlFor="msg">Your message</Label>
  <Textarea id="msg" placeholder="Type your message here..." rows={4} />
</div>

Anatomy

<Textarea id name placeholder rows disabled required />

API Reference

Textarea

Prop Type Default Description
placeholder string — Hint shown while the field is empty.
id string — id of the <textarea>, for a <Label htmlFor>.
name string — Form field name. Forwarded to the <textarea> like any other attribute.
rows number — Number of visible rows. Not set by default: the height comes from min-h-[60px].
disabled boolean — Disables the field (not-allowed cursor, 50% opacity).
required boolean — Native required attribute.
className string — Extra classes on the <textarea>.
…rest attributes — Any other prop (aria-*, data-*, maxlength…) is forwarded to the <textarea>. There is no prop for initial text: the element is rendered empty.

Keyboard

Key Action
Enter Newline (unlike Input, which submits).

Accessibility

Always pair it with a <Label htmlFor="id">. A placeholder is not a label.

Try it live Open in play

Edit this example live in the bext playground. It compiles and runs entirely in your browser.

src/app/page.tsx 1 file · react · runs in your browser
The React idiom: same UI, for comparison.