Drupal is a registered trademark of Dries Buytaert
drupal 11.3.7 Update released for Drupal core (11.3.7)! drupal 11.2.11 Update released for Drupal core (11.2.11)! drupal 10.6.7 Update released for Drupal core (10.6.7)! drupal 10.5.9 Update released for Drupal core (10.5.9)! cms 2.1.1 Update released for Drupal core (2.1.1)! drupal 11.3.6 Update released for Drupal core (11.3.6)! drupal 10.6.6 Update released for Drupal core (10.6.6)! cms 2.1.0 Update released for Drupal core (2.1.0)! bootstrap 8.x-3.40 Minor update available for theme bootstrap (8.x-3.40). menu_link_attributes 8.x-1.7 Minor update available for module menu_link_attributes (8.x-1.7). eca 3.1.1 Minor update available for module eca (3.1.1). layout_paragraphs 2.1.3 Minor update available for module layout_paragraphs (2.1.3). ai 1.3.3 Minor update available for module ai (1.3.3). ai 1.2.14 Minor update available for module ai (1.2.14). node_revision_delete 2.0.3 Minor update available for module node_revision_delete (2.0.3). moderated_content_bulk_publish 2.0.52 Minor update available for module moderated_content_bulk_publish (2.0.52). klaro 3.0.10 Minor update available for module klaro (3.0.10). klaro 3.0.9 Minor update available for module klaro (3.0.9). layout_paragraphs 2.1.2 Minor update available for module layout_paragraphs (2.1.2). geofield_map 11.1.8 Minor update available for module geofield_map (11.1.8).

views_autocomplete_api

169 sites Security covered
View on drupal.org

This module allows you to populate any autocomplete textfield via Views driven data and as little coding as possible. This is a tiny module. It is known to work with views built on top of Search API module.

This module does not package any style for now. Screenshot is an example of result you can achieve after some CSS work. Of course, we would be happy to include any provided style proposed in the issue queue !

Usage

1 - Create one or more views :

  • The last field of the View is used to show the proposed results. You can rewrite results to combine multiple fields (images, links, texts, etc.)
  • The field before will be used for injection on selection and should be plain text (you can rewrite the field as well)
  • You can use header / footer and no result behavior.
  • The exposed filters will be used to filter the view with the input of the user into the autocomplete text field (you can user AND / OR, so for example seach on users the name or email). You can still use non-exposed filters to restrict the search.
  • You can use [autocomplete] token that contains the current search input

2 - Just do a little form_alter against any textfield element :

$form['my_text_field']['#autocomplete_route_name'] = 'views_autocomplete_api';
$form['my_text_field']['#autocomplete_route_parameters'] = [
  'view_name' => 'my_view_name1,my_view_name2,...'
];

Note that the master display of the Views will be used.

Views Autocomplete Search is a good example for testing some of those functionalities applied to the search field of the core default search block.

Differences with the D7 version : you can use [autocomplete] token wherever you are (for example in the header of the View to link to a research page). Drupal 8 version supports highlighting as well.

Alternative modules:

Search Autocomplete : uses Views as well to generate autocomplete path.

Activity

Total releases
1
First release
Oct 2025
Latest release
5 months ago
Release cadence
Stability
100% stable

Releases

Version Type Release date
2.1.0 Stable Oct 28, 2025