Phone number

v4.0.0

The phone number field is a specialized text field enabling quick phone number entry.

  • Skin
  • CoreUI
  • React
Stylized artwork of a phone number 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

Phone number field diagram with 6 elements numbered: 1. Label, 2. Country dropdown, 3. Helper text, 4. Country code, 5. Value, 6. Field container.
  1. Label
  2. Country dropdown
  3. Helper text
  4. Country code
  5. Value
  6. Field container

Properties

Label

The label is required for password fields and defaults to “Phone number”.

A label sits above a phone number field.

Country code dropdown

The country code dropdown reveals a list of all supported country codes. The chosen country code updates the formatting applied to the input value.

A dropdown appears below a phone number field listing country codes: United Kingdom, United States of America, Uruguay, Uzbekistan, and Vietnam.

Country code value

The country code value updates according to chosen country code in the dropdown. If a phone number is pasted into the field with the country code included the dropdown will update and the input value formatting will adjust accordingly.

‘+1’ value is shown in the phone number field.

Input value

The input value is formatted according to the country code as characters are entered. The value is validated immediately when the field loses focus.

‘(234) 567-8900’ value is shown in the phone number field.

Behavior

Value formatting

The input value is automatically formatted according to the country code selected. This groups the values to make it easier to read and reduce the chance of making errors.

A full phone number ‘+1 (234) 567-8900’ is shown in the phone number field.

Country code value

The country code value is a dynamic text field that updates according to the country selected or the number pasted into the field. Choosing a country from the dropdown updates the country code. Pasting a value will remove the country code from the input value and replace the country code value.

Phone number input field with United Kingdom flag icon and +44 country code.

Screen sizes

Small native

On smaller native screens, the button opens a fullscreen overlay with an indexed list of countries.

Two mobile phone screens; a Payment options screen is shown on the eBay app, with an interaction indicator placed over the flag dropdown in the phone number field. A line connects the interaction indicator to the second screen, which shows a fullscreen overlay with a list of countries and country codes, with a search option on top.

Small web

On smaller web screens, the button opens a large dialog sheet.

A large dialogue sheet is featured on the eBay mobile web screen, listing countries with their country codes.

Medium and large

On medium and large screens, the dropdown opens a scrollable popover menu. Touch devices reveal a numerical keyboard where possible for the input value.

On a larger eBay Account screen, a dropdown is featured under a phone number field listing countries and their country codes.

Best practices

Modality

Do display the country code list in a fullscreen overlay on compact views. This allows for additional features like search and the native index on iOS.

A fullscreen overlay with a list of countries and country codes is shown on the eBay mobile app.

Don’t display the country code list in a bottom sheet or popover on compact views. This increases the effort required to locate an item and doesn’t support complex interactions like search and index.

A bottom half sheet with a list of countries and country codes is shown on the eBay mobile app.

Specs

Phone number field specs are shown. The height of the field container is 48px, the space between the label and field container is 4px, the space between the field container and helper text is 8px, the padding inside of the right side of the field container is 16px, the padding on the right of the country selector is 8px, and the padding on the left and right of the value field is 8px.

Change log

VersionDateNotes
4.0.0
Sep, 2024
  • Updated to eBay Evo
  • Bumped to 4.0.0 for individual versioning