nori-ui

Combobox

A searchable Select. Use for long lists or async option loading where typeahead filtering helps users find an option quickly.

7.1 kBgzipped

When to use

  • Combobox — long lists (10+ items), typeahead filtering, async option loading.
  • Select — short static lists where clicking is enough.

Combobox is a thin wrapper over Select with searchable defaulted to true. Every other prop, behavior, and type is identical — see Select's full API reference.

Basic usage

Direction:
Locale:

Async options

Pass an options function that returns a promise — Select streams results into the popup as the user types. See Select → async.

API

Combobox accepts every prop of Select. The only difference is the default value of searchable.

See Select's API reference for the full prop list.

Below is a quick reference of the most commonly used props. Full details live on the Select page.

PropNotes
value / defaultValueControlled or uncontrolled selected value. string for single, string[] for multiple.
onChangeFires with the new value on each selection change.
optionsStatic option array. Each item has value, label, and optional group / disabled.
loadOptionsAsync loader for server-backed lists. Returns { items, total? }.
multipleEnables multi-select. Trigger renders a chip per selection.
disabledDisables the control. Forwards aria-disabled.
placeholderTrigger label when nothing is selected.
searchPlaceholderLabel inside the search input field.
noOptionsMessageShown when the filter returns zero results.
loadingMessageShown while an async loadOptions call is in flight.
filterOptionCustom match predicate (option, query) => boolean.
renderOptionCustom row renderer (option, { selected, active }) => ReactNode.
dirRTL layout — set to "rtl" for Arabic / Hebrew locales.
localeBCP 47 locale tag. Enables Intl.Collator sort when sortByLocale is true.
sortByLocaleSort options via Intl.Collator. Auto-enabled when locale is set.
virtualizedRender only the visible option window. Auto-on above 100 items.
itemHeightFixed row height in px for the virtualization math. Default 36.
maxMenuHeightPopup height in px before scrolling. Default 320.
maxChipsCollapse chips to "N selected" past this count. Default 3.
maxSelectedCap the number of selected items in multi-select mode.
pageSizeAsync only — items to fetch per loadOptions call. Default 50.
idForwarded to the trigger for <label htmlFor> wiring.
aria-labelAccessible label when no visible label is present.
aria-labelledbyID of an external label element.
aria-describedbyID of a description / hint element.
aria-invalidMarks the field invalid. Injected automatically by <Field>.
aria-requiredMarks the field required. Injected automatically by <Field>.

On this page

Preview theme