Text fields allow users to input, edit, and select text.

Text fields typically reside in forms but can appear in other places, like dialog boxes and search.

Usage

Text fields validate input, help users fix errors, autocomplete words, and provide suggestions.

Field types

Single-line
Multi-line
Text area

Input types

Formatted inputs
Nested menus & pickers

Principles

Text fields should have the following characteristics:

Identifiable

Using a tappable touch target, text fields should indicate that users can enter information.

Findable

It should be easy to find a text field among other elements.

Legible

Text fields should indicate their state – whether enabled or disabled, empty or filled, valid or invalid – with clear label, input, and assistive text.

Layout

Text fields contain the following elements:

Label

Text field labels display the type of input a field requires. Every text field should have a label.
Labels are aligned with the input line and always visible. They can be resting (when a field is inactive and empty) or floating.

Input line

The input line indicates where to enter text, displayed below the label.
When a field is active or contains an error, the line’s color and thickness vary.

Cursor

The cursor indicates the user’s current input position.


In forms with some required fields, indicate all of the required ones. However, if there are fewer optional fields, indicate those instead.

NY NC ND OH

Name and zip code are the only required fields in the form.

Alabama California Delaware

Description is the only optional field in the form.

States

Text fields have two major states: enabled or disabled.

In the enabled state, these user interactions are available:

Text field is disabled.