Skip to content
Components

Combobox

Searchable input with a dropdown listbox. Filters options as you type, navigable with arrow keys.

New Keyboard Screen reader Evergreen
  • React
  • Vue
  • Svelte
  • Solid
  • Astro
  • Qwik
html
<div class="b-combobox">
  <input class="b-input" placeholder="Choose…">
  <ul class="b-combobox-list">
    <li class="b-combobox-option" data-value="A">A</li>
    <li class="b-combobox-option" data-value="B">B</li>
  </ul>
</div>

Behavior (with autoInit())

  • Typing filters the listbox
  • Arrow Down/Up navigate
  • Enter selects the active option
  • Escape closes
  • Click selects

Listening for selection

js
document.addEventListener("b:combobox:select", (e) => {
  console.log("Selected:", e.detail.value);
});

API

| Class | Effect | | --- | --- | | .b-combobox | Wrapper | | .b-combobox-list | The listbox <ul> | | .b-combobox-option | Each option <li> | | data-value="..." | The value to set on the input |

Edit this page