name thatuiuser interface

Type to filter — the list of matches under the field is the listbox popup

Combobox (Autocomplete / Typeahead)

/ role="combobox" · role="listbox" /

also called autocomplete, typeahead, search select, editable dropdown

A combobox combines an editable text field with a popup list of matching values. Typing narrows the choices while arrow keys move the active option and Enter commits it. Unlike a plain select, it supports searching or free-form input depending on the product rules.

Anatomy — every part, named

  1. 1
    Combobox inputrole="combobox"

    “The searchable dropdown field I type into” is the combobox input.

  2. 2
    Listbox popuprole="listbox"

    “The matching results underneath the field” are the listbox popup.

  3. 3
    Active optionaria-activedescendant

    “The result highlighted as I press the arrow keys” is the active option.

  4. 4
    Selected-option checkmarkaria-selected

    “The checkmark next to the choice I already picked” is the selected-option indicator.

Prompt — paste into your agent

Build a labelled Combobox with role="combobox" and a controlled role="listbox" popup. Keep aria-expanded and aria-controls in sync, give each result role="option", retain DOM focus in the input with aria-activedescendant, and support Arrow keys, Enter, and Escape without autofocusing on mount.

In code

The exact names this thing goes by in code — each row is one framework’s word for it. Use the row that matches your project (or paste it into your prompt).

ARIArole="combobox"
ARIArole="listbox"
ARIAaria-expanded
ARIAaria-controls
ARIAaria-activedescendant
HTML<datalist>a native limited alternative

See also

Search

Describe the UI element you're thinking of