Skip to content
Redpanda UI
Esc
↑↓navigate↵open⌘Jpreview
Made by shadcn
Edit on GitHub

Textarea

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

Powered by

Installation

bash
npx shadcn@latest add @redpanda/textarea
bash
pnpm dlx shadcn@latest add @redpanda/textarea
bash
yarn dlx shadcn@latest add @redpanda/textarea
bash
bunx shadcn@latest add @redpanda/textarea
bash
nubx shadcn@latest add @redpanda/textarea
bash
aube dlx shadcn@latest add @redpanda/textarea

When to use

Textarea provides multi-line text input. Use this decision tree:

Usage

tsx
import { Textarea } from '@/components/ui/textarea';
tsx
<Textarea />

Examples

Default

Disabled

With Label

With Text

With Button

Form

Appearance and behavior

Use the finite recipes instead of overriding the control’s owned border, padding, color, or typography.

Prop Supported values Use
size sm, md (default), lg Minimum height and padding
resize auto (default), none, vertical, horizontal, both Content growth or native resize direction
appearance standard (default), embedded, document Normal field, InputGroup-owned chrome, or recessed document editor
textStyle standard (default), monospace, code, code-compact Default text, monospace values, JSON, or dense code documents
tsx
<Textarea aria-label="Payload JSON" resize="vertical" textStyle="code" /><Textarea  appearance="document"  aria-label="CSS overrides"  resize="none"  spellCheck={false}  textStyle="code-compact"/>

Use InputGroupTextarea inside InputGroup; the group owns its border and focus ring. Keep className for surrounding layout and dimensions, not appearance overrides. Textarea forwards native props and refs, so controlled edits, form values, keyboard input, and validation stay native. Within Field, invalid state and error descriptions are inherited unless explicitly supplied.

For custom validation, give the editor an accessible name and associate its visible error using aria-invalid and aria-describedby. Keep an invalid JSON draft editable so users can correct it without losing their input.

The form-control matrix shows only real rest, filled, invalid, and disabled states. Its static specimens are inert; use the linked interaction gallery to exercise actual hover and keyboard focus rather than painted approximations.

Credits

  • We take our inspiration from Shadcn UI for the textarea style.

Recent changes

  • patchv1.2.0Pin shipped dependency floors to the version we develop against. Registry items now declare ranges like `^5.1.9` (the actual installed version) instead of collapsing to `^5.0.0`, so consumers start on the known-tested baseline while caret semantics still allow any compatible release within the same major.#133
  • minorv1.1.0Theme docs refresh, readability pass on semantic foregrounds, and consumer-facing Base UI regression fixes.#121
  • minorv1.0.0Post-Base-UI polish. Public API unchanged.#116
  • majorv1.0.0Migrate every Radix-based primitive to `@base-ui/react@^1.4.0` (Base UI).#114
  • minorv0.3.0Add theme-provider component to the registry with documentation and tests. Includes playground type improvements (export RegistryItem, remove as-const boilerplate) and docs site dark mode border color fix.#109
See full history →

Last updated on

Was this page helpful?