Dropdown

v4.0.0

Dropdown fields allow for selection of a value within a predetermined dataset.

  • Skin
  • CoreUI
  • React
Stylized artwork of a dropdown.

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

Dropdown anatomy with 5 elements. Number 1 points to the label, number 2 to value, number 3 to helper text, number 4 to container, and number 5 to icon.
  1. Label
  2. Value
  3. Helper text
  4. Container
  5. Icon

Properties

Labels

Labels are required for all form fields. Labels succinctly describe the field’s purpose and expected input value.

A ‘Color’ label sits above a dropdown.

Layout

Input dropdowns have multiple layout options.

  • Stacked: The field’s label is outside and above the field.
  • Floating: The label is inside the text box and animates upward on focus to make room for the input value.
Two dropdowns; A dropdown with a label above, and a dropdown with a label inside.

Required/Optional fields

Use an asterisk to indicate a field is required. Display the word “optional” in parentheses next to the field label if the field isn’t required.

If most fields are required, only indicate the optional fields. If most fields are optional, only indicate the required fields.

Two dropdowns; a dropdown with an optional label above, and a dropdown with an optional label inside.

Placeholder content

Placeholder text, or “ghost text”, is visible until a character is entered or a value is selected.

Because the placeholder text disappears, putting instructions or requirements as placeholder text is not accessible. Helper text is the preferred method to convey this information.

A ‘Colors’ dropdown with placeholder content 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 dropdown.

Error messages

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

An error message sits below a dropdown.

Size

There are two sizes available: 40px and 48px. These match our button sizes to account for situations where they are inline together. Avoid mixing different sizes in a single form.

A dropdown with a height of 40px sits above a dropdown with a height of 48px.

Read-only

Users cannot focus on or change read-only fields. Their input is derived from other parts of the UI and is intended to be viewable for reference. The input is submitted with the form.

Dropdown in a read-only state.

Disabled

Users cannot focus on or change disabled fields. Their availability depends on certain requirements. No value will be submitted from disabled fields.

Dropdown in a disabled state.

Behavior

Overflow

Content that extends beyond the width of the field is truncated before the icon.

Truncated text sits inside of a dropdown.

Min width

Bordered dropdowns have a minimum width of 2x their height. Borderless dropdowns do not have a minimum width since they hug their contents.

A bordered dropdown with a width of 96px sits above two dropdowns–a bordered dropdown with a width of 80px, and a borderless dropdown with a width of 80px.

Max width

Dropdown buttons and menus have a max width of 280px.

A max width of 280px is applied to a dropdown field.

Screen sizes

Small

Dropdown input fields launch a sheet or a popover menu depending on the platform.

The ‘Edit address’ page on the eBay mobile app is in view with the ‘Country’ dropdown selected. The screen in view has a sheet with a list of countries as options, with United States of America selected.

Native

Native apps launch a sheet or fullscreen modal when interacting with the dropdown field. The choice between the modal size is determined by the size and complexity of the list.

The ‘Edit address’ page on eBay mobile web is in view with the ‘Country’ dropdown selected, and a popover menu in focus. United States of America is selected in the menu.

Web

Small screens on web disclose a list in a popover menu.

Medium and large screens

Dropdown input fields disclose a list in a popover menu on medium and large screens across all platforms.

The eBay ‘Account’ page is in view with the ‘Country’ dropdown selected in the ‘Shipping address’ section. A popover menu is in focus, with the United States of America is selected as an option.

Specs

A dropdown component is shown with specs highlighted. Padding between the label and the dropdown is 4px, padding to the left and right of the content inside of the dropdown is 16px, padding between the placeholder text and trailing icon is 8px, and padding between the dropdown and helper text is 8px.

Change log

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