Components/Form

TextInput

Text inputs collect a single line of typed text. They suit an answer that is short and free-form, such as a name, an email address or a web address, where no set of options would cover what the reader might need to say.

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

On this page

size
state
TextInput.tsxtsx
1import { TextInput } from '@growth-protocol-ai/alpha';
2
3<>
4 <label htmlFor="playground-email">Work email</label>
5 <TextInput
6 size="regular"
7 disabled={false}
8 readOnly={false}
9 clearable
10 id="playground-email"
11 type="email"
12 placeholder="you@example.com"
13 />
14</>

When to use

Reach for a text input when the answer is a short piece of free-form text the reader types, and give it a visible label — the field is anonymous without one the moment they start typing. Let the field itself say whether it holds a value; that is what a reader reads back when they check their work.

When not to use

Do not use a text input where the answer is one of a known set, because a dropdown or a radio group asks the same question without inviting a typo. An answer that runs past one line belongs in a text area, and a question the page is expected to answer belongs in a search field.

size2 values

Size is geometry only — it never changes what the field means. Both heights are the button’s and the dropdown’s, so a form that mixes the three lines up row by row.

regular
large
sizeWhen to use
regular36px. Forms, filter bars and toolbars.
large52px. Hero forms and touch-first surfaces.