Combobox

Combobox filters one bounded synchronous option set and commits one form-backed value while data orchestration remains consumer-owned.

Overview and decision boundary

Use Combobox when one value must be selected from a bounded synchronous set that benefits from filtering.

Do not add remote fetching, debounce, ranking, creation, virtualization, multiple selection, routing, analytics, or persistence.

Filter the supported destinations and choose one value.

import { Combobox } from '@nerio-ui/ui/client';<Combobox  label="City"  name="city"  options={[    { value: 'paris', label: 'Paris', textValue: 'Paris' },    { value: 'tbilisi', label: 'Tbilisi', textValue: 'Tbilisi' },    { value: 'tokyo', label: 'Tokyo', textValue: 'Tokyo' },  ]}/>

Installation and imports

Install the editable registry source, or use the matching package entrypoint when the product keeps Nerio as a workspace dependency.

pnpm exec nerio add comboboximport { Combobox } from '@nerio-ui/ui/client';

Usage

import { Combobox } from '@nerio-ui/ui/client';<Combobox  label="City"  name="city"  options={[    { value: 'paris', label: 'Paris', textValue: 'Paris' },    { value: 'tbilisi', label: 'Tbilisi', textValue: 'Tbilisi' },    { value: 'tokyo', label: 'Tokyo', textValue: 'Tokyo' },  ]}/>

Variants

VariantPurpose
optionsOptions is part of the public component contract.
composedComposed is part of the public component contract.
flatFlat is part of the public component contract.
groupedGrouped is part of the public component contract.
smCompact size for dense layouts and inline use.
mdDefault size for most product surfaces.
lgLarger size for prominent local actions.
RTLRTL is part of the public component contract.

Anatomy

SlotPurpose
rootField root with stable state and size hooks.
labelVisible native label for the editable combobox input.
input-group / inputQuery input with clear and popup actions.
trigger / iconLocalizable popup toggle and direction-aware chevron.
content / listAnchored, collision-aware filtered listbox.
item / item-descriptionSelectable option with optional supporting text.
indicatorSelected-item check indicator.
group / group-labelLabelled grouping for related options.
empty / loadingPolite presentation regions that remain mounted.
description / messageAssociated help or validation content.

States

StateBehavior
QueryFilters the supplied synchronous items without changing selection.
OpenShows the filtered list while focus remains on the input.
Highlighted / selectedSeparates the next keyboard target from the committed value.
Empty / loadingDisplays consumer-provided presentation without owning fetching.
Disabled / read-onlyPrevents interaction while preserving truthful semantics.
Required / invalidParticipates in forms and associates validation content.

Motion

  • overlay entry and exit
  • reduced-motion immediate transition

Accessibility

  • Uses the Base UI Combobox primitive with a native visible label and active-descendant listbox navigation.
  • Query, selected value, and popup state each support independent controlled and uncontrolled ownership without mirrored state.
  • Options require stable unique generic string values and explicit textValue strings for filtering, input display, and accessible identity.
  • Arrow keys navigate enabled options, Enter commits one value, Escape closes, pointer selection retains input focus, and disabled options are skipped.
  • Description and message content are associated with the input; invalid messages use alert semantics only when invalid is true.
  • Clear and popup actions have localizable accessible names through clearLabel and toggleLabel.
  • Empty and loading presentation use dedicated polite regions that remain mounted.
  • Name, form, required, autoComplete, disabled, readOnly, and native form reset are supported.
  • Pair document dir with Base UI DirectionProvider and localize visible text plus action labels for RTL and non-English products.
  • Fetching, debounce, ranking, creation, virtualization, multiple selection, routing, analytics, persistence, and business validation remain consumer or Pro responsibilities.

Review the shared responsibility and evidence boundaries in the Accessibility foundation alongside this component-specific contract. Use the Spacing & layout foundation for shared density, wrapping, overflow, reflow, and component-versus-product ownership guidance. The Color foundation, Typography foundation, and Localization foundation define the shared visual-role, text-resilience, direction, and locale boundaries used by component examples.

API

PropsPurpose
optionsFlat or grouped data with generic string values, textValue, labels, descriptions, and disabled state.
items / childrenThe same item data paired with curated ComboboxItem composition.
query / defaultQuery / onQueryChangeIndependent controlled or uncontrolled input query.
value / defaultValue / onValueChangeIndependent controlled or uncontrolled selected value.
open / defaultOpen / onOpenChangeIndependent controlled or uncontrolled popup state.
filter / localeConsumer filter override, no filtering with false, or locale-aware contains matching by default.
loading / emptyMessage / loadingMessagePresentation only; consumers own loading and data orchestration.
name / form / required / autoCompleteForm identity, ownership, required state, reset, and autofill hint.
clearLabel / toggleLabelLocalizable names for icon-only actions.

Implementation contract

ContractValue
Registry itemcombobox installs 11 source files into the configured components directory.
Base UIcombobox
Registry dependenciesform-message, spinner
Package dependencies@base-ui/react, @nerio-ui/adapters, clsx, react, tailwind-merge, tailwindcss

Styling contract

ContractValue
AuthoringComplete, statically detectable Tailwind CSS v4 recipes own component visuals.
ValuesSemantic and component --n-* variables remain the canonical customization layer.
OverridesCustomizable slots merge consumer className values with tailwindCn so conflicting utilities resolve deterministically.
Residual CSSOnly shared keyframes and scoped no-Preflight compatibility rules remain; there is no parallel visual selector layer.

Design notes

  • Use Combobox when one value must be selected from a bounded synchronous set that benefits from filtering.

Do / do not

Do
Use for one selected value from a bounded synchronous set that benefits from filtering.
Do not
Put fetching, debounce, ranking, creation, virtualization, multiple selection, routing, analytics, or persistence in Combobox.

Tokens

These are the primary customization points. Override semantic or component tokens instead of changing component source.

TokenPurpose
--n-select-height-smPublic customization point for this component contract.
--n-select-height-mdPublic customization point for this component contract.
--n-select-height-lgPublic customization point for this component contract.
--n-select-padding-inlinePublic customization point for this component contract.
--n-select-item-gapPublic customization point for this component contract.
--n-select-item-padding-inlinePublic customization point for this component contract.
--n-select-group-label-padding-inlinePublic customization point for this component contract.
--n-select-empty-paddingPublic customization point for this component contract.
--n-select-popup-radiusPublic customization point for this component contract.
--n-input-radiusPublic customization point for this component contract.
--n-input-backgroundPublic customization point for this component contract.
--n-input-borderPublic customization point for this component contract.
--n-input-border-hoverPublic customization point for this component contract.
--n-input-border-dangerPublic customization point for this component contract.
--n-input-placeholderPublic customization point for this component contract.
--n-input-foregroundPublic customization point for this component contract.
--n-input-disabled-backgroundPublic customization point for this component contract.
--n-input-disabled-foregroundPublic customization point for this component contract.
--n-overlay-floating-z-indexPublic customization point for this component contract.
--n-overlay-backgroundPublic customization point for this component contract.
--n-overlay-borderPublic customization point for this component contract.
--n-overlay-shadowPublic customization point for this component contract.
--n-focus-ringPublic customization point for this component contract.