Skip to content
Nana UI

Combobox

An editable text field paired with a filterable listbox. Type to filter the nana-option children, then pick a value with the keyboard or pointer. The panel flips above the field when it would overflow the viewport.

Apple Banana
Terminal window
npm install @nana-tec/ui-components
import "@nana-tec/ui-components/combobox";
<nana-combobox label="Fruit" placeholder="Search…" style="min-width:16rem">
<nana-option value="apple">Apple</nana-option>
<nana-option value="banana">Banana</nana-option>
</nana-combobox>

Slot an icon into the prefix slot; clearable adds a reset button.

United States Canada Mexico
PropertyTypeDefaultDescription
labelstring''
valuestring''Selected option value (the form value)
namestring''
placeholderstring''
size'xs' | 'sm' | 'md' | 'lg''md'
openbooleanfalse
disabledbooleanfalse
requiredbooleanfalse
readonlybooleanfalse
clearablebooleanfalse
invalidbooleanfalse
helperTextstring''
errorMessagestring''
inputIdnana-combobox-${Math.random().toString(36).slice(2, 7)}
EventTypeDescription
nana-inputCustomEventFired while typing (detail.value — the query text)
nana-changeCustomEventFired when an option is selected (detail.value)
nana-clearCustomEventFired when the field is cleared
nana-focusCustomEventFired on focus
nana-blurCustomEventFired on blur
SlotDescription
(default)nana-option children
prefixLeading icon inside the field
VariableDefaultDescription
--nana-combobox-max-heightPanel max height before scrolling
PartDescription
wrapperThe bordered field container
inputThe native <input> element
panelThe floating listbox panel
  • Keyboard accessible
  • Screen-reader labels
  • Focus-visible states
  • ARIA roles and states
  • WCAG 2.2 AA contrast
Explore Combobox interactively Every state, prop, and edge case — with live controls — in Storybook.
View in Storybook