Imports
Import the wrapper when you want the standard searchable single-select experience.
Component import
ts
import { TngAutocompleteComponent } from '@tailng-ui/components';Basic usage
<tng-autocomplete> exposes query text and renders the option list you pass in. Compute local results in the parent, or replace that computed list with server results.
Basic wrapper usage
html
<tng-autocomplete
[options]="filteredCountries()"
[value]="selectedCountry()"
(valueChange)="onSelectedCountryChange($event)"
[query]="countryQuery()"
(queryChange)="countryQuery.set($event)"
[getOptionValue]="getCountryValue"
[getOptionLabel]="getCountryLabel"
placeholder="Search countries"
[ariaLabel]="'Country directory'"
></tng-autocomplete>
Style variants
The wrapper API stays the same across plain CSS and Tailwind shells.
Country directory (Plain-CSS)
Country directory
Wrapper-first autocomplete for standard country search.
- India
Selected: India
Country directory (Tailwind CSS)
Country directory
Wrapper-first autocomplete for standard country search.
- Germany
Selected: Germany
Accessibility baseline
- The wrapper renders a real input with combobox semantics from the primitive foundation.
- Arrow keys move the active option; Enter commits the current option.
- Tab leaves the autocomplete because the listbox keeps focus scoped to the trigger.
- Use the headless primitive if you need create mode, strict mode, or custom option markup.