The built-in search is a plain case-insensitive substring match. When you need
fuzzy, accent-insensitive, ranked, or remote results, hand the whole search off to searchCallback โ the component stays dependency-free and just renders what you return.
searchCallback is called as (term, signal) => Promise<T[]>.
Wire the AbortSignal into fetch so that when the user keeps typing, the
previous in-flight request is aborted and its stale results never overwrite the newer ones.
ES01 Async searchCallback
Debounced, min-length-gated async search with AbortSignal cancellation.
Controls
ms
Quick usage
search-debouncewaits N ms after the last keystroke before firing the callback โ fewer requests while typing fast.min-search-lengthholds the callback until at least that many characters are typed.- Each new term aborts the previous request via the
AbortSignal; the callback returns[]whensignal.abortedso late responses are discarded.
searchCallback