ARIA Combobox
The ARIA Combobox provides an accessible input field with a popup containing selectable options, following WAI-ARIA patterns.Installation
Components
Combobox
The main container that orchestrates combobox behavior. Selector:[ngCombobox]
Source: /home/daytona/workspace/source/src/aria/combobox/combobox.ts:60
Inputs
filterMode(‘manual’ | ‘auto-select’ | ‘highlight’) - How filtering behaves:manual- Consumer is responsible for filtering optionsauto-select- Automatically selects the first matching optionhighlight- Highlights matching text without changing selection- Default:
'manual'
disabled(boolean) - Whether the combobox is disabled. Default:falsereadonly(boolean) - Whether the combobox is read-only. Default:falsealwaysExpanded(boolean) - Whether the popup should always be visible. Default:falsefirstMatch(V | undefined) - The value of the first matching itempreserveContent(boolean) - Whether to preserve popup content when closed
Properties
expanded(signal) - Whether the combobox popup is expandedinputElement(signal) - The connected input element, if any
Methods
open()- Opens the combobox to the selected itemclose()- Closes the combobox
ComboboxInput
The input field for the combobox. Selector:[ngComboboxInput]
Inputs
value(string) - The current input valueplaceholder(string) - Placeholder text
ComboboxPopup
The popup container that displays options. Selector:[ngComboboxPopup]
ComboboxPopupContainer
Template directive for popup content. Selector:[ngComboboxPopupContainer]
ComboboxDialog
Dialog variant of the combobox. Selector:[ngComboboxDialog]
Basic Usage
Auto-Select Mode
Always Expanded
With CDK Overlay
Keyboard Navigation
- Arrow Down - Open popup and move to next option
- Arrow Up - Move to previous option
- Enter - Select focused option and close
- Escape - Close popup
- Tab - Close popup and move focus
- Type characters - Filter/search options
Accessibility Features
- Implements ARIA combobox pattern (ARIA 1.2)
role="combobox"on inputaria-expandedstate managementaria-controlslinking to popuparia-activedescendantfor virtual focus- Full keyboard navigation
- Screen reader announcements
Use Cases
The combobox component can be used for:- Autocomplete - Search with suggestions
- Select - Dropdown selection
- Multiselect - Multiple option selection
- Typeahead - Search-as-you-type