A Base UI (Angular) combobox is a searchable single-select with keyboard listbox behavior, optional create, and an optional baseComboboxOption template. Bind options and ngModel; for async search set filterMode to none and handle queryChange — or drive options from httpResource. Cookbook: http-resource.
Install with npx base-ui-cli add combobox.
Playground
<base-combobox [options]="people" [(ngModel)]="selected" placeholder="Search people…" [disabled]="false" [allowCreate]="false"> </base-combobox>
Selected: grace
<base-combobox [options]="people" [(ngModel)]="selected"></base-combobox>
TypeScript
import { Component } from '@angular/core';
// Install: npx base-ui-cli add combobox
// Paths are relative to aliases.components (default: src/app/components)
import { ComboboxOptionContext, ComboboxOptionDirective } from './combobox/combobox-option.directive';
import { ComboboxComponent } from './combobox/combobox.component';
@Component({
selector: 'app-combobox-example',
imports: [
ComboboxComponent,
ComboboxOptionDirective
],
template: `...`
})
export class ComboboxExampleComponent {}Install
npx base-ui-cli add combobox
Project ng-template baseComboboxOption to render avatars, secondary copy, or badges in the listbox. Import ComboboxOptionDirective. Context: let-option, let-selected="selected", let-active="active", let-index="index".
<base-combobox [options]="people" [(ngModel)]="selected">
<ng-template baseComboboxOption let-option>
<span>Ada Lovelace</span>
</ng-template>
</base-combobox>TypeScript
import { Component } from '@angular/core';
// Install: npx base-ui-cli add combobox
// Paths are relative to aliases.components (default: src/app/components)
import { ComboboxOptionContext, ComboboxOptionDirective } from './combobox/combobox-option.directive';
import { ComboboxComponent } from './combobox/combobox.component';
@Component({
selector: 'app-combobox-example',
imports: [
ComboboxComponent,
ComboboxOptionDirective
],
template: `...`
})
export class ComboboxExampleComponent {}Install
npx base-ui-cli add combobox
Set [allowCreate]="true" to add the current query when it is not in the list.
<base-combobox [options]="items" [allowCreate]="true" (create)="onCreate($event)"></base-combobox>
TypeScript
import { Component } from '@angular/core';
// Install: npx base-ui-cli add combobox
// Paths are relative to aliases.components (default: src/app/components)
import { ComboboxOptionContext, ComboboxOptionDirective } from './combobox/combobox-option.directive';
import { ComboboxComponent } from './combobox/combobox.component';
@Component({
selector: 'app-combobox-example',
imports: [
ComboboxComponent,
ComboboxOptionDirective
],
template: `...`
})
export class ComboboxExampleComponent {}Install
npx base-ui-cli add combobox
Parent filters. Combobox shows a loading spinner while results catch up. Pair queryChange with httpResource in the httpResource cookbook.
<base-combobox filterMode="none" [loading]="loading" [options]="results" (queryChange)="search($event)"></base-combobox>
TypeScript
import { Component } from '@angular/core';
// Install: npx base-ui-cli add combobox
// Paths are relative to aliases.components (default: src/app/components)
import { ComboboxOptionContext, ComboboxOptionDirective } from './combobox/combobox-option.directive';
import { ComboboxComponent } from './combobox/combobox.component';
@Component({
selector: 'app-combobox-example',
imports: [
ComboboxComponent,
ComboboxOptionDirective
],
template: `...`
})
export class ComboboxExampleComponent {}Install
npx base-ui-cli add combobox
Async search already covers loading. Empty lists and validation copy belong next to the field. App-wide empty copy defaults to provideBaseUiI18n().
TypeScript
import { Component } from '@angular/core';
// Install: npx base-ui-cli add combobox
// Paths are relative to aliases.components (default: src/app/components)
import { ComboboxOptionContext, ComboboxOptionDirective } from './combobox/combobox-option.directive';
import { ComboboxComponent } from './combobox/combobox.component';
@Component({
selector: 'app-combobox-example',
imports: [
ComboboxComponent,
ComboboxOptionDirective
],
template: `...`
})
export class ComboboxExampleComponent {}Install
npx base-ui-cli add combobox
Site-wide VPAT-style notes live on the accessibility report.
Run the following command to add this component to your project:
npx base-ui-cli add combobox
For AI agents
Copy a prompt with the registry name, CLI install, and import — or add the Base UI MCP server.
npx -y base-ui-ng-mcp
Base UI provides standalone components. Import the exact elements you want to use into your component.
// Install: npx base-ui-cli add combobox
// Paths are relative to aliases.components (default: src/app/components)
import { ComboboxOptionContext, ComboboxOptionDirective } from './combobox/combobox-option.directive';
import { ComboboxComponent } from './combobox/combobox.component';
@Component({
selector: 'app-your-component',
imports: [
ComboboxComponent,
ComboboxOptionDirective
],
template: `...`
})
export class YourComponent {} API for combobox — generated from JSDoc in the library source.
| API | Member | Type | Default | Description |
|---|---|---|---|---|
ComboboxOptionContext | $implicit | ComboboxOption | — | — |
ComboboxOptionContext | option | ComboboxOption | — | — |
ComboboxOptionContext | selected | boolean | — | — |
ComboboxOptionContext | active | boolean | — | — |
ComboboxOptionContext | index | number | — | — |
base-combobox | class | string | '' | Additional host classes. |
base-combobox | label | string | '' | Visible label above the field. |
base-combobox | placeholder | unknown | 'Search…' | Placeholder when nothing is selected. |
base-combobox | options | ComboboxOption[] | [] | Options shown in the listbox. Override the row with `<ng-template baseComboboxOption>`. |
base-combobox | filterMode | 'local' | 'none' | 'local' | `local` filters by label; `none` shows `options` as-is (use with `queryChange` for async search). |
base-combobox | loading | boolean | false | Shows a spinner in the panel (async search). |
base-combobox | allowCreate | boolean | false | Allows creating the current query when it matches no option. |
base-combobox | emptyText | string | — | Empty-state copy when no options match. When omitted, uses `provideBaseUiI18n().noResults`. |
base-combobox | disabled | boolean | false | Disables the field. Also set by Angular Forms via `setDisabledState`. |
base-combobox | (queryChange) | string | — | Emits the typed query on every change. |
base-combobox | (create) | string | — | Emits when the user creates a value that is not in `options`. |
base-combobox | (selectionChange) | string | null | — | Emits the selected option value. |
[baseComboboxOption] | — | — | — | Marks an `ng-template` as the option renderer for . When omitted, the listbox shows `option.label` and optional `option.description`. |
Content