# KptAutocomplete (kpt-autocomplete) A field with suggestions on CDK Overlay, Signal Forms. The value is the typed text. Requires `import '@angular/cdk/overlay-prebuilt.css';` Import: `import { KptAutocomplete } from '@konce-pt/angular';` ## Inputs - `value`: model; `options`: string[]; `placeholder`: string - `disabled`/`invalid`/`touched`: boolean; `touch`: output - Keyboard: ArrowUp/ArrowDown to navigate, Enter selects, Esc closes. ## Example ## Screen reader and keyboard The WAI-ARIA combobox-with-list pattern: focus stays in the field, `aria-autocomplete="list"`, `aria-controls` and `aria-activedescendant` point at the active suggestion, and a polite live region says how many suggestions there are (`autocomplete.results`) or that there are none (`autocomplete.noResults`). Matching ignores case and diacritics ("lodz" finds "Łódź"). `ArrowUp` from the field goes to the last suggestion; the first `Escape` closes the list, the second clears the field. ## Label and description `id` goes to the native field - the host never carries it; without one it is generated. Inside `kpt-form-field` the control links itself: the wrapper's `label[for]` points at it and the hint or error is added to `aria-describedby`, so `controlId` is not needed. Without a wrapper, name it with `ariaLabel`. ## Tokens `--kpt-form-field-*`, the panel `--kpt-color-surface-raised`. ## Read-only and required `readonly` is the native read-only field with `aria-readonly`; the suggestions do not open and Escape does not clear the value. ## Dictation - Dictation (`speech*` below) needs `provideKptSpeech()` in the app - see `kpt-speech-button`. - `speech`: boolean = false - a microphone at the end of the field (`kpt-speech-button`). Hidden without browser support. - `speechLang`: string | null - BCP 47 tag; without it from `KptI18n.locale`. - `speechColor`: `'primary' | 'danger' | 'success' | 'warning' | 'info'` = `'primary'` - colour of "stop" and the wave while listening. - `speechMode`: `'insert' | 'append' | 'replace'` = `'replace'` - the field picks one value, so a click clears it and one utterance replaces it; the suggestion list opens for the spoken text like for typed text. Interim words are visible but do not filter the list - only final text reaches the model.