Autocomp.js Save Abandoned

A super tiny Javascript autocomplete / autosuggestions library. Zero dependencies, ~800 bytes min+gzip.

Project README

autocomp.js

A super tiny Javascript autocomplete / autosuggestion library. Zero dependencies and ~800 bytes minified + gzipped.

View demo

demo

Usage

Node

npm install @knadh/autocomp
import { autocomp } from @knadh/autocomp;

autocomp(document.querySelector("#q"), {
	onQuery: async (val) => {
		// fetch() or whatever that fetches/generates results.
		return ["results", "here"];
	},

	onSelect: (val) => {
		alert(val);
		return val;
	}
});

Check the demo source to see advanced usage and basic CSS styles.

ES6 module

Check the demo source to use the lib in <script> directly on an HTML page.

Licensed under the MIT License.

Open Source Agenda is not affiliated with "Autocomp.js" Project. README Source: knadh/autocomp.js
Stars
221
Open Issues
0
Last Commit
8 months ago
License
MIT

Open Source Agenda Badge

Open Source Agenda Rating