Ark Logo
Undefined
Components
Combobox

Combobox

A single input field that combines the functionality of a select and input.

You can explore the combobox component in the following curated examples.

Anatomy

To set up the combobox correctly, you'll need to understand its anatomy and how we name its parts.

Each part includes a data-part attribute to help identify them in the DOM.

Examples

Learn how to use the Combobox component in your project. Let's take a look at the most basic example

Advanced Customization

Extended example that shows usage with complex item objects, including disabled state for certain options.

Using the Field Component

The Field component helps manage form-related state and accessibility attributes of a combobox. It includes handling ARIA labels, helper text, and error text to ensure proper accessibility.

Using the Root Provider

The RootProvider component provides a context for the combobox. It accepts the value of the useCombobox hook. You can leverage it to access the component state and methods from outside the combobox.

If you're using the RootProvider component, you don't need to use the Root component.

API Reference

Accessibility

Complies with the Combobox WAI-ARIA design pattern.

Keyboard Support

KeyDescription
ArrowDown
When the combobox is closed, opens the listbox and highlights to the first option. When the combobox is open, moves focus to the next option.
ArrowUp
When the combobox is closed, opens the listbox and highlights to the last option. When the combobox is open, moves focus to the previous option.
Home
When the combobox is open, moves focus to the first option.
End
When the combobox is open, moves focus to the last option.
Escape
Closes the listbox.
Enter
Selects the highlighted option and closes the combobox.
Esc
Closes the combobox