In-depth Guides
Angular Aria

Autocomplete

Overview

An accessible input field that filters and suggests options as users type, helping them find and select values from a list.

Usage

Autocomplete works best when users need to select from a large set of options where typing is faster than scrolling. Consider using autocomplete when:

  • The option list is long (more than 20 items) - Typing narrows down choices faster than scrolling through a dropdown
  • Users know what they're looking for - They can type part of the expected value (like a state name, product, or username)
  • Options follow predictable patterns - Users can guess partial matches (like country codes, email domains, or categories)
  • Speed matters - Forms benefit from quick selection without extensive navigation

Avoid autocomplete when:

  • The list has fewer than 10 options - A regular dropdown or radio group provides better visibility
  • Users need to browse options - If discovery is important, show all options upfront
  • Options are unfamiliar - Users can't type what they don't know exists in the list

Features

Angular's autocomplete provides a fully accessible combobox implementation with:

  • Keyboard Navigation - Navigate options with arrow keys, select with Enter, close with Escape
  • Screen Reader Support - Built-in ARIA attributes for assistive technologies
  • Three Filter Modes - Choose between auto-select, manual selection, or highlighting behavior
  • Signal-Based Reactivity - Reactive state management using Angular signals
  • Popover API Integration - Leverages the native HTML Popover API for optimal positioning
  • Bidirectional Text Support - Automatically handles right-to-left (RTL) languages

Examples

Auto-select mode

Users typing partial text expect immediate confirmation that their input matches an available option. Auto-select mode updates the input value to match the first filtered option as users type, reducing the number of keystrokes needed and providing instant feedback that their search is on the right track.

Manual selection mode

Manual selection mode keeps the typed text unchanged while users navigate the suggestion list, preventing confusion from automatic updates. The input only changes when users explicitly confirm their choice with Enter or a click.

Highlight mode

Highlight mode allows the user to navigate options with arrow keys without changing the input value as they browse until they explicitly select a new option with Enter or click.

APIs

Combobox Directive

The ngCombobox directive provides the container for autocomplete functionality.

Inputs

Property Type Default Description
filterMode 'auto-select' | 'manual' | 'highlight' 'manual' Controls selection behavior
disabled boolean false Disables the combobox
firstMatch string - The value of the first matching item in the popup

Outputs

Property Type Description
expanded Signal<boolean> Signal indicating whether the popup is currently open

ComboboxInput Directive

The ngComboboxInput directive connects an input element to the combobox.

Model

Property Type Description
value string Two-way bindable string value of the input using [(value)]

ComboboxPopupContainer Directive

The ngComboboxPopupContainer directive wraps the popup content and manages its display.

Must be used with <ng-template> inside a popover element.

Autocomplete uses Listbox and Option directives to render the suggestion list. See the Listbox documentation for additional customization options.