Skip to main content
Mantı UI logoMantı UIv0.13.0
Studio

Combobox

Pass options as { value, label, disabled? }. Filtering runs by label while the Zag.js machine manages focus, keyboard navigation, and selection.

import { Combobox } from '@manti-ui/react';

const spices = [
  { value: 'sumac', label: 'Sumac' },
  { value: 'paprika', label: 'Paprika' },
  { value: 'cumin', label: 'Cumin' },
  { value: 'mint', label: 'Dried mint' },
  { value: 'pepper', label: 'Black pepper' },
  { value: 'chili', label: 'Chili flakes' },
  { value: 'coriander', label: 'Coriander' },
];

export default function ComboboxBasic() {
  return (
    <div className="w-full max-w-[calc(var(--manti-space-16)*5)]">
      <Combobox items={spices} label="Spice" placeholder="Search spices…" />
    </div>
  );
}

Appearance

Use variant="fill" for a neutral filled control. size uses the shared size scale: the portalled list follows the control, so a sm Combobox filters into sm rows.

Multiple selection

Set multiple to collect several values.

SumacDried mint

API

PropTypeDefaultDescription
itemsComboboxItem[]—The full option set; filtered client-side as the user types. Each item is { value, label, disabled? }.
labelReactNode—Optional field label.
placeholderstring'Search…'Input placeholder text.
variant'default' | 'fill''default'Visual treatment for the control.
size'sm' | 'md' | 'lg''md'Control size.
maxVisibleItemsnumber200How many matching rows the listbox renders at once. Typing filters the whole item set; a line under the rows says how many matches are still hidden.
multipleboolean—Allow selecting more than one option.
valuestring[]—Controlled selected values.
defaultValuestring[]—Initial selected values for uncontrolled usage.
onValueChange(value: string[]) => void—Called whenever the selection changes.
placementPlacement'bottom-start'Placement of the listbox relative to the control.
disabledboolean—Disable the control.
invalidboolean—Mark the field as invalid.
requiredboolean—Mark the field as required.
namestring—Form field name.

Styling

Anatomy

PartSelectorDescription
root[data-scope="combobox"][data-part="root"]The field wrapper; carries data-size and data-variant.
label[data-scope="combobox"][data-part="label"]The field label.
control[data-scope="combobox"][data-part="control"]Wraps the input and toggle button.
input[data-scope="combobox"][data-part="input"]The typeahead text input.
trigger[data-scope="combobox"][data-part="trigger"]The button that toggles the listbox open.
positioner[data-scope="combobox"][data-part="positioner"]Positions the floating listbox.
content[data-scope="combobox"][data-part="content"]The translucent listbox panel.
item[data-scope="combobox"][data-part="item"]A selectable option.
item-indicator[data-scope="combobox"][data-part="item-indicator"]The check mark shown on selected items.
overflow-hint[data-scope="combobox"][data-part="overflow-hint"]The line under the rows when more matches exist than maxVisibleItems.

Tokens

TokenControls
--manti-combobox-heightheight
--manti-combobox-padding-xpadding x
--manti-combobox-icon-sizeicon size
--manti-combobox-content-max-heightcontent max height
--manti-combobox-content-paddingcontent padding
--manti-combobox-content-gapcontent gap
--manti-combobox-item-padding-yitem padding y
--manti-combobox-item-padding-xitem padding x
--manti-combobox-item-gapitem gap
--manti-combobox-item-radiusitem radius
--manti-combobox-item-font-sizeitem font size

Last updated

Built end-to-end with Manti UI components and design tokens. Manti UI is a framework-agnostic design system on Zag.js.

GitHub