Initialization
After installation, you can import and use the library in your JavaScript or TypeScript files. Library attaches to existing search input element. Once a search input is loaded, autocomplete
function can initialize event listeners for the Search Autocomplete.
❗autocomplete
should be called once.❗
Property | Required | Default Value | Description |
---|---|---|---|
inputSelector | Yes | N/A | Input element to attach the autocomplete to |
dropdownSelector | Yes | N/A | Dropdown element to attach the autocomplete to (empty container's selector should be provided) |
render | Yes | N/A | Function to render the dropdown |
fetch | Yes | N/A | Function to fetch the search state |
submit | No | Search API request | Function to submit the search |
minQueryLength | No |
| Minimum length of the query before searching (applied on typing in autocomplete and used in default |
historyEnabled | No |
| Enables search history component |
historySize | No |
| Max number of history items to show |
nostoAnalytics | No |
| Enable Nosto Analytics |
googleAnalytics | No |
| Google Analytics configuration. Set to |
Last updated