Textarea

A styled multi-line text input with smooth focus transitions and shadow effects.

Basic

With label

With character count

Up to 160 characters.

Error state

Feedback is required.

Disabled

Installation

pnpm
pnpm dlx @hex-core/cli add textarea

With label

Textarea paired with a label

tsx
<div className="grid gap-1.5">
  <Label htmlFor="message">Message</Label>
  <Textarea id="message" placeholder="Type your message..." />
</div>

API Reference

PropTypeDefaultDescription
placeholder
stringPlaceholder text
rows
number3Number of visible text rows
disabled
booleanfalseDisable the textarea
value
stringControlled textarea value
defaultValue
stringDefault value for uncontrolled usage
onChange
functionChange handler: (e: ChangeEvent<HTMLTextAreaElement>) => void
className
stringAdditional CSS classes

AI Guidance

When to use

Use for multi-line text input: comments, descriptions, messages, notes. Always pair with a Label.

When not to use

Don't use for single-line input (use Input). Don't use for rich text editing.

Common mistakes

  • Missing associated Label
  • Not setting a reasonable min-height or rows

Accessibility

Always pair with a Label using htmlFor/id. Consider aria-describedby for character limits.

Related components

Token budget: 250