Components/Form

TextArea

Text areas collect several lines of typed text. They suit an answer whose length the reader decides — a description, a note, a message — and they grow with what is written, a line at a time, so a short answer is not framed by an empty box and a longer one is not squeezed into a single line.

import { TextArea } from '@growth-protocol-ai/alpha';

On this page

size
state
TextArea.tsxtsx
1import { TextArea } from '@growth-protocol-ai/alpha';
2
3<>
4 <label htmlFor="playground-report">What happened?</label>
5 <TextArea
6 size="regular"
7 disabled={false}
8 readOnly={false}
9 id="playground-report"
10 placeholder="Describe the problem in your own words…"
11 />
12</>

When to use

Reach for a text area when the answer is prose the reader composes and its length is theirs to decide — a description, a reason, a message. Give it a visible label, and let it open at about the length the question deserves: a field that opens tall asks for more words than you meant to ask for, and one that opens short makes a considered answer feel unwelcome.

When not to use

Do not use a text area for an answer that is one line by nature — a name, an email address, a web address. Those belong in a text input, and the test is not how long the answer runs but whether a line break could ever belong inside it. An answer that is one of a known set is a dropdown or a radio group, and a question the page itself is meant to answer is a search field.

size2 values

Size is geometry only — it never changes what the field means. Both open at two lines and stop three lines later, so what a size buys is not capacity but the type the text is set in and the room around it.

regular
large
sizeWhen to use
regular14/24 in a 240px frame — the single-line field’s width, so the two line up in a form without arithmetic.
large16/28 in a 320px frame. Hero forms and touch-first surfaces, and the better choice for anything long enough to be re-read.