Purpose
A combobox combines a text input with an associated dropdown list. It allows users to either type a value or select from a predefined set of options, with optional filtering.
Usage Guidance
- Use when there are too many options for a radio group or standard select
- Provide a clear label indicating what should be entered or selected
- Support both keyboard entry and list selection
- Consider whether an autocomplete behavior is appropriate
Accessibility Considerations
- Follow the ARIA combobox pattern (APG): the input has
role="combobox" - The associated listbox has
role="listbox"and each option hasrole="option" aria-expandedon the input reflects whether the listbox is visiblearia-controlson the input references the listboxidaria-activedescendanton the input references the focused option’sid
Keyboard Support
| Key | Action |
|---|---|
Down Arrow |
Open listbox; move focus to first option |
Up Arrow |
Move focus to previous option |
Down Arrow |
Move focus to next option |
Enter |
Select focused option; close listbox |
Escape |
Close listbox without selecting |
Home / End |
Move to first/last option |
Screen Reader Behavior
Screen readers announce the input label, “combobox” role, and whether it is expanded. As the user navigates options, each option label is announced via aria-activedescendant.
ARIA Requirements
role="combobox"on the<input>aria-expanded="true|false"on the<input>aria-controls="listbox-id"on the<input>aria-activedescendant="option-id"on the<input>(when an option is focused)role="listbox"on the dropdown containerrole="option"on each list itemaria-selected="true"on the currently selected option
Common Mistakes
- Using a custom combobox when a native
<select>would suffice - Not updating
aria-activedescendantduring keyboard navigation - Hiding the listbox with
display:nonewithout updatingaria-expanded - Poor focus management when the listbox closes
Live Example
- 1.1.1 Non-text Content
- 1.3.1 Info and Relationships
- 1.4.3 Contrast (Minimum)
- 2.1.1 Keyboard
- 4.1.2 Name, Role, Value
Code Pattern
<label for="combobox-input">Search criteria</label>
<div class="combobox-wrapper">
<input
id="combobox-input"
role="combobox"
type="text"
aria-expanded="false"
aria-controls="combobox-list"
aria-autocomplete="list"
aria-activedescendant=""
autocomplete="off"
>
<ul id="combobox-list" role="listbox" hidden>
<li id="opt-1" role="option" aria-selected="false">Option 1</li>
<li id="opt-2" role="option" aria-selected="false">Option 2</li>
</ul>
</div>