NG Kit

Free solo

Allows arbitrary values that are not bound to the options — ideal for a search or “creatable” field. freeSolo lets the raw text become the value, and a createFilterOptions filter surfaces an “Add …” entry so users can commit new values.

Usage

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

html
<autocomplete
  [options]="films"
  [freeSolo]="true"
  [(value)]="value"
  [filterOptions]="filter"
  appearance="outline"
  label="Search" />

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
freeSolobooleanfalseAllow arbitrary values not bound to the options.
filterOptionsFilterOptionsFn<T>createFilterOptions()Custom filtering function. Pass passThroughFilter for server-side search.
selectOnFocusboolean!freeSoloSelect the input text on focus.
clearOnBlurboolean!freeSoloClear the input text on blur when there is no value.
handleHomeEndKeysboolean!freeSoloMove highlight with Home/End keys.