Components · Form

Select

A select lets the user choose one option from a list. It looks and behaves like an input field, with a dropdown arrow. It opens the ECO Menu as its list.

Every example on this page is the real component, not a picture. Click, tab and choose an option to try it. Figma: Base Input (shared with Input).

Playground

Choose a breakpoint, size and state and the select and its code update. Hover and focus are forced here. The select is live: choose an option to get the Active state.

Breakpoint
Size

Markup for this selection

HTML

Overview

A select lets the user choose one option from a list. It looks and behaves like an input field, with a dropdown arrow. It opens the ECO Menu as its list.

Select has three sizes on desktop (Large, Small, XSmall) and two on mobile (Large, Small), seven states and an optional message. It is a native <select>: the value, the label and the form submission come from the browser, and select-menu.js only replaces the popup.

This documentation has three pages. Examples & Guidelines (this page) shows when and how to use a select. Specifications holds the values: tokens, sizes, measurements, states and requirements. Code shows how to add one to a page.


Usage

When to use

Use a select when the user picks one value from a list of more than about five options. Use it to:

  • Choose a country, a region or a store from a long list
  • Pick one value where a list of radio buttons would take too much space
  • Filter or sort a list in a compact surface (Small or XSmall)

When not to use

Select or radio buttons

For two to five options, show them all with eco-radio: the user sees every option without opening anything. For a longer list use a select, so the list does not take over the form.

Do use a select for a long list of options.
Do not list many options as radio buttons. Use a select instead.

Label and placeholder

A placeholder is not a label: it is replaced once an option is chosen. Every select has a visible label, and the placeholder option only prompts the user.

Do give every select a visible label.
Do not use the placeholder as the label.

For several values or free text

When the user picks any number of options, use eco-checkbox. When the user types free text, use eco-input.

Quick reference

The user…Use
picks one value from a list of more than about fiveSelect
picks one of two to five optionseco-radio
picks any number of optionseco-checkbox
types free texteco-input

Do

  • Give every select a visible label.
  • Use a placeholder option with an empty value as the prompt.
  • Pick the size by breakpoint, like the input.
  • Show the message with the error icon.

Don’t

  • Use a select for two or three options: use radio.
  • Use the placeholder as the label.
  • Rely on color alone for error or success.
  • Hardcode colors or heights: use the tokens and size classes.

Anatomy

Select

  1. Label. label-md or label-sm, uppercase, 4px above the box.
  2. Select text. body-md (Large) or body-sm. The placeholder is text-tertiary.
  3. Arrow. A 24px Material Symbols icon, 12px from the right edge. The field keeps 40px of right padding so text never runs under it.
  4. Message. body-sm, 4px below the box. Hint, error or success.

The focus ring is a separate element around the box, 2px and 3px outside it, so focusing never changes the layout or the box size.

Menu

The list is the ECO Menu (eco-menu): it opens under the field, as wide as the field. A Large field opens a Large menu; Small and XSmall open a Small menu.


Variants

A select has no type variants. What changes is the message and the state.

Messages

The message sits below the field in body-sm. Hint text is neutral; error and success change the border and message color. An error message has a leading icon so color is never the only signal.


Sizes

Three sizes on desktop (Large 48px, Small 40px, XSmall 32px) and two on mobile (Large 40px, Small 32px). Use the Breakpoint toggle to preview Desktop (769px and up) and Mobile (below 769px).

Breakpoint

Large is for standard forms, Small for compact surfaces, XSmall for dense tables and filters (desktop only: on mobile it is not available, use Small). The list is the Menu: Large field opens a Large menu, Small and XSmall open a Small menu. Measurements are under Sizes in Specifications.


Layout & Appearance

Width

The field is as wide as its container, and the menu is as wide as the field. Set the width on the container.

Appearance

The box has a 1px border and a white fill, like the input, with a dropdown arrow on the right. The border turns black when the field is in use or has a value. Token names and values are under Design Tokens in Specifications.


Behavior

Opening the menu

A click opens the Menu under the field (no ring on mouse). Click a row to choose; click outside to close. Try it:

Placeholder

A first option with value="" (disabled, hidden) shows the placeholder in text-tertiary.

Hover and focus

Hover is border-hover. On keyboard focus the box keeps border-input-default and only the ring shows, like the input. All states are listed under States in Specifications.

Error, success and disabled

Set aria-invalid="true" on an invalid field and point aria-describedby at the message. A disabled select is not focusable: it has a grey fill, a light border and text-disabled text and arrow.


Accessibility

All requirements are listed under Accessibility Requirements in Specifications.

Keyboard support

Enter, Space and the arrow keys open the Menu on the chosen row. Up and Down, Home and End move; Enter or Space choose; Escape closes and returns focus to the field; Tab closes.

Screen reader support

The control stays a native select with a label (for and id). The Menu list is a listbox with option rows, named by the label. An invalid field gets aria-invalid="true" and aria-describedby that points at the message.



References