Menu

Textarea

Multi-line input. 3 styles × 4 states.

Installation

$ npx uix-ui@latest add textarea

This copies the file into components/ui/textarea.tsx in your project. npx shadcn@latest add @uix/textarea works too.

Usage

textarea.tsx
import { Textarea } from "@/components/ui/textarea";

<div style={{ width: 360, maxWidth: "100%" }}>
  <Textarea label="Gift note" placeholder="Write a few words for the card." rows={3} />
</div>

Examples

Filled and error

Tell us a little more (20 characters at least).

Props

PropTypeDefaultDescription
appearanceoutline | filled | underline"outline"
labelReact.ReactNode–
secondaryLabelReact.ReactNode–Right-aligned note next to the label, for example "Optional".
feedbackReact.ReactNode–Message under the field.
helperReact.ReactNode–Same as feedback.
errorstring–Error message; also marks the field invalid and replaces the feedback.

Everything else is passed to the root element, so className, aria-* and event handlers work as usual.

Dependencies

Installed for you by the CLI.

  • class-variance-authority
  • clsx
  • tailwind-merge
  • lib/utils.ts
esc

↑↓ to navigate · ↵ to select · esc to close