Select your language
Select other languages

Automatic translation

Loading translator…

Magoomake your components work correctlyBack to homepage

Autocomplete

Offers suggestions while typing, distinguishing text being edited, the active option, and the committed value.

For working examples and design patterns for this component, see the references tab (opens the references on this page).

COMPONENT GUIDE

Explore behaviors before defining the interface.

Quick guide for designers

When to use

Use when suggestions help find or fill a value. For a few visible options, consider a simpler control.

What to design

Show the label, field, suggestion list, active option, committed value, loading, no options, and failure.

How it behaves

Typing requests suggestions. Navigating options need not commit a choice; Enter commits according to the documented pattern.

What to document in Figma

Define free or restricted input, query triggers, committing, canceling, and the effect of leaving the field.

How to review

Check states in the design. In the implementation, verify editing, the active option, and committing with keyboards and screen readers.

Choose the behavior

Options and states

Commit and cancel

Interaction Methods

Mouse and touch

Clicking or tapping a suggestion commits its value. The list must not disappear before activation completes.

Keyboard

Tab enters the field. Typing, selection, copying, and pasting retain native editing commands.

With the list open, Down and Up arrows navigate suggestions; Enter commits the active option; Esc closes the list without committing a merely highlighted option.

Tab leaves the field without traversing every suggestion. In this explicit commitment pattern, leaving does not automatically commit the active option.

Screen readers

On focusing the field with a screen reader, people identify its name and whether suggestions are open. Using Up or Down arrows navigate options and identify the active option; Enter commits it.

With a mobile screen reader, people type using the virtual keyboard, traverse suggestions with the reader’s navigation gestures, and double tap the focused option to commit. The list may report the count or absence of suggestions after the response.

Gherkin

BDD (Behavior-Driven Development) methodology focusing on three pillars: User Stories, Acceptance Criteria, and Gherkin Syntax (Given, When, Then).

Scenario: Given that I am on a page containing Autocomplete

Educational scenarios for reviewing behavior. Adapt them to context and execute them in the implementation; the presence of this text does not mean tests were performed.

Keyboard navigation

Screen reader on desktop

Screen reader on mobile devices

Additional scenarios — editorial extension

Navigate without committing

Commit an option

Out-of-order responses

No match with restricted input

Points to consider

Suggestion autocomplete differs from the HTML autocomplete attribute, which informs browser autofill.

Do not place actionable links or buttons inside listbox options. Content with independent actions requires a different pattern.

Request cancellation and stale response handling need implementation. The design documents intent but does not prove the behavior.

Implementation notes and behavior decisions

Expose the name, expanded state, and relationship to the list. With aria-activedescendant, DOM focus remains in the field and the active option must exist and be identified in the list.

The count or absence of suggestions can be communicated after a response without announcing every keystroke. Also verify exploration and commitment with a mobile screen reader.

References

Additional references for components of type Autocomplete.

Important:
Most references are on the course platform alongside the lessons cited in this material.

Disclaimer:
The links listed here are a curated collection of references where you can find implemented components, rather than recommendations. There is no unified implementation format and no guarantee that these links follow every design pattern. Direct questions to the teams responsible for the linked materials. Before copying a model, remember that all materials are constantly updated and that patterns, particularly proprietary ones, may change.

Technical references and examples consulted for this editorial adaptation. Each source retains its scope; consulting an example does not prove accessibility of another implementation.

W3C APG — Combobox (external link, opens in a new tab)

W3C APG — Listbox (external link, opens in a new tab)

Original content by Marcelo Sales, initially used in the AccessBoost course (external link - opens in a new window). These interactions represent standard industry patterns, but may be customized in specific cases, provided there are sufficient instructions for people to understand the behavioral change.