Skip to content

autocomplete

autocomplete(opts): void

Defined in: components/autocomplete.ts:84

A combobox with type-ahead filtering. Supports single or multi-select (chips), optional free-text entry, and full keyboard control (arrows, enter, escape, backspace-to-remove). Implements the ARIA combobox/listbox pattern.

AutocompleteOptions

void

// Single select from a fixed list
const $sel = A.proxy("Netherlands");
S.autocomplete({ label: "Country", options: ["Belgium", "Netherlands"], bind: $sel });
// Multi-select, disallowing custom items
const $tags = A.proxy({value: [] as string[]});
S.autocomplete({
label: "Tags",
multi: true,
allowCustom: false,
options: ["Rust", "JS", "C++", "Klingon", "Go"],
bind: A.ref($tags)
});