Skip to content

Dropdown ​

Picks one or more values from a fixed list.

components-advanceddropdown--defaultOpen in Storybook ↗

When to use ​

  • Any choice from a closed list in forms, inline editors, filters and toolbars: Status, Language, Sort by.
  • Several values from the same list: use the multi-select.

When not to use ​

Anatomy ​

  1. Field: input-shaped, --radius-input corners, --control-height high, value in --text-value. It shows the value, or a placeholder in --color-text-placeholder.
  2. Clear button (optional): a ✕ when the dropdown can be cleared and has a value.
  3. Chevron: points down when closed and up when open; a spinner replaces it while options load.
  4. List: a card under the field, --radius-card, --shadow-overlay, --color-border-subtle border. Options are set in --text-table; the hovered or keyboard-focused option gets --color-accent-wash.
  5. Option: an optional icon, then the label. The selected option in a single select shows a check; in a multi-select every option has a checkbox.
  6. Search (long lists): with more than ten options, you can type in the field to filter the list.

Variants ​

VariantWhereLooks
Borderedevery dropdown that stands on its own — use this by default--color-border-default border
Light borderdense panels--color-border-subtle border
Borderlessinside another controlno border
Multi-selectseveral values from one listcheckboxes; the field shows {n} selected; the list stays open while you pick
Label in valuecompact toolbarsthe field reads Sort: Title instead of only the value
components-advanceddropdown--multi-searchOpen in Storybook ↗

A dropdown that is not required starts its list with — No value, in placeholder ink. Picking it clears the field. Required dropdowns have neither this option nor the ✕.

Options stay in the order they are configured. A list of up to 20 options makes the field as wide as its longest option.

States ​

StateWhat you seeTrigger
Closedvalue or placeholder, chevron down—
Hoverborder darkens (--color-border-dashed)pointer, bordered variant
Openlist under the field; the field keeps the focus ringclick, Space
Searchingthe list narrows as you typetyping, lists of more than ten options
Selecteda check (single) or a ticked checkbox (multi) on the optionpick
Loadingspinner in the field; the open list shows three grey placeholder rowsoptions are being fetched
Emptythe list says No optionsno options available
Disabled--color-surface-muted fill; it does not openthe field is unavailable
components-advanceddropdown--statesOpen in Storybook ↗

Picking a value only changes the field. The form or inline editor around it saves the change.

Keyboard & accessibility ​

KeyClosedOpen
Spaceopens the listpicks the focused option (when nothing is typed)
Typingopens the list and filters it (long lists)filters the list (long lists)
↓ / ↑—next / previous option (wraps)
Enter—picks the focused option
Backspace—with nothing typed: removes the last value of a multi-select
Escape—closes the list without a change
Tabmoves oncloses the list and moves on

A single select closes after a pick; a multi-select stays open. A click outside the list closes it.

  • The field is a role="combobox" with aria-expanded, aria-haspopup and aria-controls pointing to the list.
  • The list is a role="listbox" (aria-multiselectable for a multi-select); each option is a role="option" with aria-selected.
  • The checkboxes in a multi-select are decorative and hidden from screen readers; the selection is announced through aria-selected.
  • While options load, the dropdown has aria-busy="true" and the placeholder rows are hidden from screen readers.

Content ​

  • The label names the value, as a noun: Status, Language.
  • The placeholder asks for a choice: Choose a status.
  • Option labels are short, in sentence case, and don't repeat the label: Draft, not Status draft.
  • Fixed texts: No value, {n} selected, No options.

Autocomplete · Text input · Checkbox · Overflow menu · Loading · Accessibility

Powered by Elody - Open Source Semantic Data Platform