</> ConvertAtlas Developer Tools
Bootstrap 5 · Advanced

Fuzzy Search List

A typo-tolerant fuzzy search over a list, via Fuse.js.

Requires Bootstrap 5, Fuse.js. Add the CDN tags below to your page (styles in <head>, scripts before </body>). The downloaded file already includes them.
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/fuse.js@7.0.0/dist/fuse.min.js"></script>
<div class="card border-0 shadow-sm" style="max-width:360px"><div class="card-body"><input class="form-control mb-2" id="fzInput" placeholder="Fuzzy search…"><ul class="list-group list-group-flush small" id="fzList"></ul></div></div>
var data=['JavaScript','TypeScript','Python','Rust','Go','Ruby','Swift','Kotlin'];
var fuse=new Fuse(data,{threshold:.4}),inp=document.getElementById('fzInput'),list=document.getElementById('fzList');
function render(r){list.innerHTML=(r.length?r:data.map(function(d){return {item:d}})).map(function(x){return '<li class="list-group-item px-0 py-1">'+(x.item||x)+'</li>'}).join('')}
inp.addEventListener('input',function(){render(inp.value?fuse.search(inp.value):[])});render([]);
Free to use.This component uses Bootstrap 5, Fuse.js (linked above). Copy any file, or download a ready-to-open .html page with the CDN links already included.