search ESC

Autocomplete

Type-ahead search that filters a list of options. Falls back to static DOM filtering when no JS source is provided — perfect for small inline datasets.

Static list

Pre-rendered items are filtered live as you type.

React
Vue
Svelte
Angular
Solid
Qwik
Preact
JS array source

Pass an array programmatically via new Autocomplete(el, { source: [...] }).

Async source (fake API)

Pass an async function as source. Useful for real API-backed lookups.

Options reference
OptionDefaultPurpose
minChars1Minimum characters before searching
delay300Debounce delay in ms
maxResults10Cap number of shown items
highlighttrueHighlight matched substring in results
sourcenullArray, async fn, or null (falls back to DOM items)
labelKey"label"Object property used as display label
valueKey"value"Object property used as value