@metacorp/html-trie
v0.1.2
Published
Blazing fast, <1kb search library
Downloads
21
Readme
Html Trie
Html binding for Trie
Installation
NPM
npm install @metacorp/html-trie @metacorp/trie
CDN
<script src="https://unpkg.com/@metacorp/trie"></script>
<script src="https://unpkg.com/@metacorp/trie-html"></script>
Usage
Initialize Trie with an array of data.
const htmlTrie = new HtmlTrie(Trie, ['Apple', 'Lemon', 'Orange', 'Tomato'])
Now bind an input with searchBox
htmlTrie.searchBox({
container: document.getElementById('searchBox')
})
And an result element with hits
htmlTrie.hits({
container: document.getElementById('hits')
})
Configuration
// Don't preprocess at all
HtmlTrie.config.hitClassName = 'result-item'
License
Licensed under the MIT License
Copyright (c) Meta [email protected]