Typeahead/autosuggest plugin for Ajax-datasources
npm install dcx-typeahead
npm install -D dcx-typeahead
`
$3
Include the typeahead plugin:
`
const typeahead = require('dcx-typeahead')
`
Instantiate the plugin on a text input:
`
typeahead(document.querySelector('input[type="text"]') [,options, project])
`
$3
#### options
The following options can be passed in as an object:
Option | Description | Default
--- | --- | ---
autosuggest.template | Template used to render the results in the autosuggest |
autosuggest.maxResults | Number of results that are parsed in the autosuggest list | 5
autosuggest.resultsMaxHeight | Height in pixels necessary to show the results below the input field | 100
class | Object with classes added to the typeahead elements. | { activeItem: 'typeahead-is-active'/added to an active item in the autosuggest list/, input: 'typeahead-input', ul: 'typeahead-ul'}`