Text Field

Android · iOS · Web
A Text Field allows users to enter, edit and submit free-form text.

Overview

Text Fields allow users to input free-form text or numerical information in forms, search bars and login pages.

Live demo

Content
Modifiers

Usage

Do

  • Use when users need to input unique information not covered by preset options.

  • Use when the expected user input is a single line of text.

  • Always use a clear label for better accessibility and understanding.

Don't

  • Avoid using free-form Text Field when users must select from a predefined list. Opt for Drop-Down, Select, or Radio Button Group.


Placement

The Text Field is versatile, fitting anywhere in the UI requiring user input—alone or grouped with other input components for form creation.


Content

Labels

  • Texts Fields should have labels. A field without a label is ambiguous and not accessible.

  • Search bars supplemented with a search icon, and multiple Text Fields for address lines are an exception to this, and can be made accessible with aria-label or hidden text.

  • Follow capitalisation rules. Text Field labels should be in sentence case.

Helper text

Optional helper text can provide additional guidance for users.

  • Use helper text to show hints, formatting and requirements.

  • Write error text that shows a solution.

  • Don’t use helper text to simply restate the same information in the label or if it isn’t relevant to the specific field.

  • Use complete sentences that end with a full stop, not an exclamation point.

Placeholder text

Don’t use placeholder text to provide essential information, labels or instructions. Once a value is entered, placeholder text is no longer viewable, which makes it not accessible.

Optional fields

In a single form, mark the less frequent of optional or required fields with an asterisk, or ‘(required)’ in the label.

Passwords

Show asterisks for password entry. Set type on the Text Field to password to use the default browser password behaviour for security.

Sizes

Text Fields come in three different sizes: small, medium, and large. Medium is the default and the most frequently used option.

ExampleSizeWhen to use

Example helper text

MediumThis is the default size and the most commonly used size. When in doubt, use the medium size.

Example helper text

SmallUse when space is constricted or when placing a text input into a form that is long and complex.

Example helper text

LargeUse when there is a lot of space to work with. The large size is typically used in simple forms or when a text input is placed by itself on a page..

Width variations

The Text Field should be large enough to accommodate the expected length of the input data. The width of a Text Field can be customised appropriately depending on the content and context.

States and interactions

The Text Field should change its appearance based on its state to provide feedback to users.

ExampleSizeWhen to use
EnabledInitial state displaying the label and input field in default styles.
HoverOccurs when the user hovers over the input field.
Error message
ErrorAppears when the user inputs invalid data.
Error focusThe error focus state occurs when the user inputs invalid data, and the input field is also in focus. For touch devices the keyboard is shown.
FocusThe focus state occurs when the input field is selected, and the cursor is blinking. For touch devices the keyboard is shown.
SuccessThe success state occurs when the user inputs valid data, and the input field should change its style to indicate that there is no error.
Success focusThe success focus state occurs when the user inputs valid data, and the input field is also in focus. For touch devices the keyboard is shown.
DisabledShows that an input field exists but is not available in that circumstance. This can be used to maintain layout continuity and communicate that a field may become available later.
Read-onlyText fields have a read-only option for when content in the disabled state still needs to be shown. This allows for content to be copied, but not interacted with or changed.

Disabled Text Fields

Due to usability and accessibility issues that arise from using disabled and read-only fields, we suggest considering alternative design patterns. This includes using plain text when possible or validating on submit and guiding users directly to errors with sensible error messages.

Accessibility

  • Clearly label Text Fields for user understanding.

  • Set appropriate keyboard types based on expected input.

  • Enable secure text entry for sensitive information.

  • Implement input validation for expected formats.

  • Ensure Text Fields are easily navigable, fillable, and submittable using only the keyboard.

iOS guidance

Along with the guidance above, there is some iOS specific guidance for this component.

  • Ensure that the Text Field is accessible to users with disabilities. Set appropriate accessibility labels and hints to assist users relying on VoiceOver.