Skip to content
界面图谱Interface Atlas
☰
中文
ComponentsForm

Combobox

可搜索选择框

Aliases:可以搜索的下拉框输入筛选选项自动补全选择autocomplete

What is it

A text field paired with a list of suggestions. People type to narrow a set, then commit a value with pointer or keyboard. Typed text, the active suggestion and the committed selection are separate states. Provide a clear empty result and a way to clear the field when nothing matches.

Interactive playground

Try it. Make an informed choice.

Type a keyword, choose with arrows and Enter, then try no results and clear the selection.

Loading lab…

What to look for

  • 01The active descendant must reference an existing option.
  • 02Clearing restores options; Escape closes the list.

✓ When to use

  • Choose a city, team member or style from a sizable known set.
  • Filter while typing while preserving a clear committed value.

✕ When not to use

  • Use radios for only two or three choices.
  • Use a plain input when there is no suggestion set.

Variants

Editable

可输入筛选

Type to filter suggestions.

Select only

只选不输

Choose a fixed value without free-form input.

Implementation

position: relativeoverflow-y: auto:focus-visible

Keep focus in the input and point aria-activedescendant at the active option. Connect aria-expanded, aria-controls, listbox and option semantics. Support arrows, Enter and Escape, and reset the active index when filtering changes.

Related concepts

Applicable styles

Sources

Markdown for agents · JSON