Password

v4.0.0

The password field automatically hides its input. It includes a trailing icon that toggles the entry masking.

Stylized artwork of a password field.

Considerations

Performant

Forms allow users to complete fields effortlessly.

Accessible

Anyone, no matter their abilities, can complete forms.

Dynamic

Forms provide dynamic feedback so users can correct errors quickly and confidently.

Anatomy

Password field diagram with 4 elements numbered: 1. Label, 2. Value, 3. Helper text, 4. Visibility toggle.
  1. Label
  2. Value
  3. Helper text
  4. Visibility toggle

Properties

Label

A label is required for password fields and defaults to “Password”. The included label can be hidden if there is another adjacent text element acting as the label.

An empty password field with a ‘Password’ label.

Value

The password value is submitted with the form. It is obfuscated with dots by default.

A password field with hidden values.

Layout

There are two layouts available for password fields, stacked and floating. Stacked labels are above the field and floating labels are inside the field. A floating label animates upward on focus to make room for the value.

Two password fields; A password field with a label above, and a password field with a label inside.

Helper text

Helper text is placed below the field and informs the user of any requirements or disclaimers. Helper text can be shown persistently or on focus.

Helper text sits below a password field.

Error messages

When a field fails validation, the helper text produces an error message to help users successfully fulfill the password requirements. Error messages are concise and direct, and replace any previously visible helper text. An error icon is prepended to the helper text to improve discoverability.

An error message sits below a password field.

Size

There are two sizes available: 48px and 40px. These sizes match available button sizes in case they’re inline together. Avoid mixing different sizes in a single form.

Two password fields; a password field with a 40px height sits above a password field with a 48px height.

Behavior

Overflow

Longer passwords flow beyond the visible container. While focused, the value overflows to the left to keep the cursor in view as characters are entered. When the field loses focus, the value shifts to the beginning and overflows to the right. Focusing on the field again returns to the end of the value.

An enabled state password field sits above a focused state password field with the typing cursor in view.

Privacy toggle

The privacy icon toggles between showing and hiding the characters entered to aid in situations where the password needs to be reviewed.

The icon conveys what will happen when interacted with, not the current state, so a concealed value has the show icon and a revealed value has the hide icon.

A password field with the privacy toggle ‘on’ sits above a password field with the privacy toggle ‘off’.

Screen sizes

Small

Password fields span the full width of the screen on smaller screens.

A password field spanning the full width of a mobile eBay sign in screen.

Medium and large

Password fields are aligned to the grid on larger screens up to the max width. Avoid allowing password fields to span the full screen width.

A password field spanning the full width of a modal on a larger eBay sign in screen.

Specs

A password field component is shown with specs highlighted. The space between the label and password field is 4px, padding on the left and right of content inside of the password field is 16px, padding between the value field and the trailing icon is 8px, the space between the password field and helper text is 8px, and the height of the password field is 48px.

Change log

VersionDateNotes
4.0.0
Sep, 2024
  • Updates to Evo
  • Bumped component version to 4.0 to begin individual versioning