Textarea

A labelled multi-line input with an optional hint and error message.

We pass this to the courier.
import { Textarea } from '@brand-studio/ui';

export default function TextareaDemo() {
  return (
    <div style={{ width: '100%', maxWidth: 380 }}>
      <Textarea label="Delivery note" hint="We pass this to the courier." placeholder="Leave it with the concierge." />
    </div>
  );
}

Installation

pnpm add @brand-studio/ui

Usage

import { Textarea } from '@brand-studio/ui';
<Textarea label="Delivery note" hint="We pass this to the courier." />

Examples

Error

Pass error to show the message under the field and mark it invalid.

Keep it under 120 characters so it fits on the card.

import { Textarea } from '@brand-studio/ui';

export default function TextareaError() {
  return (
    <div style={{ width: '100%', maxWidth: 380 }}>
      <Textarea label="Gift message" defaultValue="Happy birthday! Enjoy three months of fresh coffee, delivered every other Friday, and think of me with every single cup you pour." error="Keep it under 120 characters so it fits on the card." />
    </div>
  );
}

Accessibility

  • The label is a real <label> tied to the textarea.
  • hint and error join aria-describedby, so screen readers read them after the label. error also sets aria-invalid.
  • The box grows with its text up to 20rem where the browser supports field-sizing, and the user can still drag it taller.

API Reference

PropTypeDefault
labelstring
hint?string
error?string

Also accepts every TextareaHTMLAttributes<HTMLTextAreaElement> attribute.

Still, Deskhand and Hollis are fictional brands. The coffee photographs are original generated artwork. @brand-studio/ui is MIT licensed.