Autocomplete
Autocomplete (autoComplete.js) is a simple, pure vanilla Javascript library progressively designed for speed, high versatility, and seamless integration with a wide range of projects & systems. It has no dependencies, includes powerful search engine with two different modes, is highly customizable and works with regular inputs (text field, textarea and contentEditable elements).
Basic usage

Simple example of search field with autocomplete. Includes a few overrides of default options to make it work like a regular suggestion engine: highlight of matching bit and display selected item in the field value.

Disable selection

By default, autocomplete displays the list of mathing results, but doesn't update input value when menu item is selected. This can be changed via selection input event. This example shows the default behaviour.

Threshold

Threshold option is responsible for setting threshold value of the minimum characters length where autoComplete.js engine starts. In this example threshold value is set to 3. Type nia to see it in action

Debounce

Debounce option is responsible for setting delay time duration (in milliseconds) that counts after typing is done for autoComplete.js engine to start. Default value is 0, in this example it's set to 500ms.

Search engine

SearchEngine option is responsible for setting the Search engine Type/Mode or custom engine. Supports strict (default) and loose modes. In this example searchEngine option is set to loose.

Open list on focus

The library includes onfocus event, which provides extra customization of search results. In this example results list is triggered on focus when suggestion is selected. Choose some country and then click on input field.

Multiple choices

With additional configuration of query option and selection event, search field can support multiple selection separated by comma. Example below demonstrates this behaviour.

Counter

Display total number of matches and current count of maximum displayed items set in JS configuration. Works in combination with maxResults option that sets the limit of items displayed in the menu.

No results

The message that is shown to the user when search query doesn't match any data entry can be easily customized via resultsList set of options. Type "Sweden" to see it in action

Disabled highlight

By default, autocomplete doesn't highlight matching characters in the list of results, but shows the list of general matches. To change this behaviour, set highlight option to true in resultItem option.

External data source

This example loads external JSON file with a list of countries. You can easily customize appearance of results and selection, add dynamic placeholders or loading indicators in data configuration.

Ignore duplicates

External data set includes duplicated value - Austria. This example filters out all duplicates in data set and returns a single value. This behaviour can be easily achieved with filter configuration option

Recent searches

Results list can include search history in a simple list format. You can customize its appearance in resultsList option and selection event. Select some country and then trigger the menu again.

Start with

The data can be filtered in a way that the list will include only the exact query starting from the 1st word. If you type A, United Arab Emirates will be ignored since the 1st letter in the 1st word doesn't contain that query.

Activity
New notifications
James has completed the task Submit documents from Onboarding list
2 hours ago
Margo has added 4 users to Customer enablement channel
3 hours ago
Subscription #466573 from 10.12.2021 has been cancelled. Refund case #4492 created
4 hours ago
Older notifications
Nick requested your feedback and approval in support request #458
3 days ago
Mike added 1 new file(s) to Product management project
new_contract.pdf
112KB
1 day ago
All hands meeting will take place coming Thursday at 13:45.
2 days ago
Christine commented on your community post from 10.12.2021
2 days ago
HR department requested you to complete internal survey by Friday
3 days ago
Loading...
Demo configuration
Color mode
Direction
Layouts
Purchase Limitless