OptionalbuildOptionalextraQuery-driven action rendered as the FIRST CommandItem, so it owns cmdk's
Enter (cmdk re-highlights the first item on every input change) and joins
arrow-key navigation. id must be distinct from every row id.
OptionalfacetsDrilldown facets rendered below the search box. Their selected values are
forwarded to fetchPage as facets[key], so the backing service must
accept them. Omit for a plain (search-only) selector.
Fetches one page of options; { ok: false } becomes the error state.
OptionalgetOptional monospaced secondary label (e.g. an id) shown on rows that fall
back to the default renderRow.
OptionalinitialServer-rendered first page; see useInfiniteOptions. Default view only.
OptionalisMarks a row unselectable while keeping it listed — for an option that exists but can't be used here. Prefer this over filtering: a missing row reads as "no such account", a disabled one as "this one, but not yet".
OptionallinkLink mode: the host's typed link component (e.g. admin's PageLink).
OptionalmultipleWhether a pick accumulates (multi-select) or replaces the last (single).
In link mode the combobox owns that toggle math; in callback mode the
caller does, and this drives the row affordance (checkbox vs. check mark)
and aria-multiselectable so the control doesn't advertise the wrong
contract. Defaults to multi-select.
Plural noun, e.g. "customers" — used in counts, error, and empty copy.
OptionalonCallback mode: clears the selection. Unused in link mode.
OptionalonCallback mode: toggles a row in the selection. Unused in link mode.
OptionalqueryBase react-query key. Defaults to ["infinite-combobox", noun]; pass a
distinct key when two comboboxes share a noun but return different rows.
OptionalrenderReplaces the default empty copy when the result set is empty. Fed the live (undebounced) query so the caller can name what it searched for. Use it to explain WHY a constrained list is empty; omit it for the default copy.
OptionalrenderRenders below the list, fed the live (undebounced) search text — an escape
hatch for NON-interactive hints. Anything actionable belongs in extraItem
(a footer sits outside cmdk's listbox, so keys never reach it).
OptionalrenderThe row's inner content (name / id lines), sans checkbox. Omit it to get
getLabel + getSublabel as a two-line pair, the same fallback the
popover uses.
Live selection for this dimension (drives the checked + pinned state).
Resolved rows for the committed selection — seeds pinned rendering so an off-page selection is still shown while it's not on a loaded page.
OptionalsortSort choices; the first is the default. Omit for an unsorted source.
Link mode: serialize a full next-selection of ids to its URL. The combobox owns the toggle math (add/remove for multiple, replace for single) and calls this with the resulting id set — so hrefs are always computed from the live optimistic selection, never a stale mounted URL. Set with
linkComponentto render rows as optimistic soft-nav links;onToggle/onClearare unused.