NG Kit

Playground

Flip every input live to see how the autocomplete reacts. Toggles bind to multiple, freeSolo, loading, readOnly, the auto-behaviours, sizes and appearance, so you can explore the whole surface in one place.

Usage

Import AutocompleteComponent and configure it with the inputs below. The full runnable source is on the Examples tab.

html
<autocomplete
  [options]="films"
  [(value)]="value"
  [multiple]="multiple()"
  [freeSolo]="freeSolo()"
  [loading]="loading()"
  [appearance]="appearance()"
  [size]="size()"
  label="Movie" />

API

This example demonstrates the inputs below. See the Autocomplete introduction for the complete API — every input, output, content template and filter helper.

Inputs

NameTypeDefaultDescription
multiplebooleanfalseAllow selecting several values, rendered as chips.
freeSolobooleanfalseAllow arbitrary values not bound to the options.
disableClearablebooleanfalseHide the clear button / prevent clearing.
readOnlybooleanfalseMake the control read-only.
loadingbooleanfalseShow a loading indicator and loadingText.
autoHighlightbooleanfalseAutomatically highlight the first option.
autoSelectbooleanfalseSelect the highlighted option on blur.
disableCloseOnSelectbooleanfalseKeep the popup open after a selection.
openOnFocusbooleanfalseOpen the popup as soon as the input is focused.
showCheckboxesbooleanfalseRender a checkbox in front of each option (multiple).
appearance'fill' | 'outline''fill'Material form-field appearance.
size'small' | 'medium''medium'Field density.