Combobox Pattern Fundamentals
You'll learn: How to understand the combobox pattern that combines a text input with a dropdown list for powerful autocomplete and selection interfaces.
What Is a Combobox?
A combobox is a hybrid UI component that merges a text input field with a listbox popup. Think of it like the search bar in Google or the address bar in your browser—you can type to filter suggestions, arrow down to browse them, and select one or navigate away to use your typed value.
Unlike a simple <select> element (dropdown-only) or a plain text field (no suggestions), a combobox gives users the flexibility to either type freely or pick from suggestions. It's especially powerful for searchable lists (countries, products, tags) where scrolling through hundreds of options would be tedious.
Core Characteristics
A combobox consists of:
- Text input where users type (the primary interface)
- Popup listbox that appears with filtered or suggested options
- Dual interaction modes: typing to search/filter and keyboard navigation to browse options
- State management: tracking whether the listbox is expanded, which option has focus, and what text is entered
The combobox must communicate its expanded/collapsed state and the relationship between the input and the list to assistive technologies using ARIA attributes (which you'll learn next).
When to Use It
Use a combobox when users need to:
- Search through a large list (cities, products)
- Get autocomplete suggestions (email addresses, tags)
- Either select from options or enter custom text (a "create new" scenario)
Key Takeaway: A combobox combines text input with a filterable listbox, giving users the power to type freely while offering helpful suggestions—a pattern requiring careful ARIA setup and keyboard support to be accessible.