Star 历史趋势
数据来源: GitHub API · 生成自 Stargazers.cn
README.md

autocomp.js

A super tiny Javascript autocomplete / autosuggestion library. Zero dependencies and ~1300 bytes minified + gzipped. Uses the native Popover API.

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, items) => {
		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.

关于 About

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

语言 Languages

HTML53.8%
JavaScript46.2%

提交活跃度 Commit Activity

代码提交热力图
过去 52 周的开发活跃度
8
Total Commits
峰值: 3次/周
Less
More

核心贡献者 Contributors