Dropdown

v4.0

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

  • CSS
  • Marko
  • 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

Label

Required. The label names what the dropdown controls.

  • Use sentence case
  • No ending punctuation
  • Use a noun or noun phrase
  • Aim for 1–3 words
A ‘Color’ label sits above a dropdown.

Value

The value is the option the user selects. Each option should be short, distinct, and easy to scan.

  • Use sentence case, except for proper nouns or branded terms
  • No ending punctuation
  • Use parallel structure
A ‘Color’ label sits above a dropdown. The dropdown has the following options listed, “walnut”, “maple”, “cherry” and “ash”. “Walnut” is selected”.

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 text

Placeholder text, or “ghost text,” gives users a hint about the expected input format. Use realistic examples of what a user might enter, not descriptions of the field.

Placeholder text disappears when the user starts typing, so don’t use it for instructions or required information.

  • Use sentence case
  • No ending punctuation
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

Error messages appear below the field when the input doesn't meet the required format or conditions. The error message replaces any existing helper text.

Keep the tone neutral, don’t blame or scare the user. Clearly inform users know how to fix it.

  • Use sentence case
  • No ending punctuation
  • Avoid technical language or filler words like “please”, “sorry”, or “oops”
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

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.