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
| Option | Default | Purpose |
|---|---|---|
minChars | 1 | Minimum characters before searching |
delay | 300 | Debounce delay in ms |
maxResults | 10 | Cap number of shown items |
highlight | true | Highlight matched substring in results |
source | null | Array, async fn, or null (falls back to DOM items) |
labelKey | "label" | Object property used as display label |
valueKey | "value" | Object property used as value |