Forms · 8 parts · 7 states · Intermediate

Text Input

Lets the user enter and edit a single line of text.

01Anatomy

Email*
ada@example.com
We only use it for the receipt.

8 parts. Select a number or a name to see what each part does.

01 · Label

Names the field. It stays visible while the user types.

Required
Yes
Recommended
Short, above the field. A placeholder is not a label.

02 · Required indicator

Marks a mandatory field, often with an asterisk or the word “required”.

Required
Only in some cases
When
Only on mandatory fields. Some systems mark the optional ones instead.
Recommended
Explain the asterisk once at the top of the form, and set required in code too.

03 · Field

The box that receives the input. Border and fill change with the state.

Required
Yes
Recommended
Its width hints at the expected length: a postcode field can be short.

04 · Leading icon

Hints at the type of content, like a mail or search symbol.

Required
No
When
Avoid it when it repeats the label and adds nothing.

05 · Input text

The text the user types. When the field is empty, placeholder text can sit here.

Required
Yes
Recommended
Common pattern: a placeholder only for an example, like name@example.com. Put the format rule in the helper text: the placeholder disappears as you type.

06 · Trailing action

An action on the content: clear, show password. Or a unit or a status icon.

Required
No
When
Depends on the content.
Recommended
If it can be clicked, it is a real button with its own label.

07 · Helper text

Short guidance under the field: format, purpose, constraints.

Required
No
When
Useful when the rule isn’t obvious.
Recommended
Give the rule before the mistake, not only after.

08 · Error message

Says what went wrong and how to fix it. Often takes the place of the helper text.

Required
Only in some cases
When
Only when validation fails.
Recommended
Text plus an icon, never colour alone: “Enter an email like name@example.com”.

Shares its area with Helper text.

02Structure

  • Text Inputcomponent setauto layoutvertical
  • Labelauto layouthorizontal
  • Texttext
  • Requiredtextboolean
  • Fieldauto layouthorizontalfillhugpadding 12gap 8
  • Leading iconinstanceboolean
  • Valuetextfill
  • Trailing actioninstanceboolean
  • Helper texttextboolean
Structure
PropertyTypeValues
StateVariantEmptyHoverFocusFilledDisabledRead-onlyError
SizeVariantSmallMediumLarge
RequiredBooleantruefalse
Leading iconBoolean + Instance swapmailsearch…
Trailing actionBoolean + Instance swapclearshow password
Helper textBoolean + Text“We only use it…”
ValueText“ada@example.com”

Keep the Error state showing the message in the helper slot, so the layout doesn’t jump.

03States

EmptyWaiting for input. A placeholder may show a format example.
HoverThe border gets a bit stronger under the pointer.
FocusThe caret is in the field and you can type. Stronger border or ring.
FilledContains a value. A clear action may appear.
DisabledCan’t be edited or focused, and its value isn’t sent with the form.
Read-onlyCan be read, selected and copied, not changed. Its value is still sent.
ErrorThe value didn’t pass validation. The message says how to fix it.

04Variants

OutlinedA border on all sides. The most common pattern.
FilledA filled background with a bottom line.
Prefix and suffixA unit or currency outside the value, like € or kg.
SearchA search icon and often a button to clear the text.

There is no single correct anatomy: names, variants and properties differ from one design system to another. These are common structural models distilled from established design systems and accessibility guidance.

Fuori Frame

Proven methods for designing interfaces with AI. Every two weeks, in Italian.

Subscribe