Back
This example shows a multi-select autocomplete where selected tags are displayed inline within the input field, and a clear icon is used.
const languageAutocomplete = new AvalynxAutocomplete('#languageSearch', {
data: languages,
maxSelections: 5,
tagsPosition: 'inline',
clearStyle: 'icon',
defaultSelections: [
{ key: 'LNG001', value: 'German' },
{ key: 'LNG002', value: 'English' }
],
onChange: (keys, values) => console.log('Languages:', keys, values)
}, {
placeholder: 'Add languages (max. 5)...',
noResults: 'No languages found',
removeTitle: 'Remove'
});
AvalynxAutocomplete on GitHub Avalynx on GitHub