---
id: "packages/active-ui/combobox"
title: "Combobox"
description: "An input that filters a list as the reader types, for one value or several as chips."
url: "/packages/active-ui/combobox"
locale: "en"
revision: "79d28d20cb0be9d7"
---

# Combobox

A combobox lets the reader type to narrow a list, then choose. Use it when the list is too long to
scan, or when the reader knows what to look for: a city, a currency, a colleague. It filters on the
client; for a list that comes from a server as the reader types, use [`AsyncCombobox`](/packages/active-ui/async-combobox). For a ready
search picker with its trigger and messages, see the composed [`SearchCombobox`](/packages/active-ui/search-combobox).

**Example: One value with clear, several as chips**

Client: Runs entirely in your browser. Source: `examples/ui/combobox.tsx`.

```tsx
// apps/docs/examples/ui/combobox.tsx
'use client';

import {useState} from 'react';

import {
  Combobox,
  ComboboxChip,
  ComboboxChips,
  ComboboxChipsInput,
  ComboboxContent,
  ComboboxEmpty,
  ComboboxInput,
  ComboboxItem,
  ComboboxList,
  ComboboxValue,
  useComboboxAnchor,
} from '@workspace/active-ui/components/primitives/combobox';
import {
  Field,
  FieldDescription,
  FieldLabel,
} from '@workspace/active-ui/components/primitives/field';

// A fixed list; a list from a server belongs in AsyncCombobox.
const CITIES = [
  'Amsterdam',
  'Antwerp',
  'Berlin',
  'Brussels',
  'Copenhagen',
  'Dublin',
  'Lisbon',
  'Madrid',
  'Paris',
  'Rotterdam',
  'Utrecht',
  'Vienna',
];

/**
 * Type to filter a list, then choose: one value in an input with a clear
 * button, and several values as chips in one field. `items` is the full
 * list; the combobox filters it as you type and renders the matches through
 * the function child of `ComboboxList`.
 */
export default function ComboboxExample() {
  const [city, setCity] = useState<string | null>(null);
  const [offices, setOffices] = useState<string[]>(['Utrecht']);
  const anchor = useComboboxAnchor();
  return (
    <div className="grid w-full max-w-sm gap-8">
      <Field>
        <FieldLabel htmlFor="combobox-city">Head office</FieldLabel>
        <Combobox items={CITIES} value={city} onValueChange={setCity}>
          <ComboboxInput
            id="combobox-city"
            placeholder="Search a city"
            triggerLabel="Show cities"
            showClear
            clearLabel="Clear head office"
          />
          <ComboboxContent>
            <ComboboxEmpty>No city matches.</ComboboxEmpty>
            <ComboboxList>
              {(item: string) => (
                <ComboboxItem key={item} value={item}>
                  {item}
                </ComboboxItem>
              )}
            </ComboboxList>
          </ComboboxContent>
        </Combobox>
        <FieldDescription>Value: {city ?? 'none'}</FieldDescription>
      </Field>

      <Field>
        <FieldLabel htmlFor="combobox-offices">Branch offices</FieldLabel>
        <Combobox
          items={CITIES}
          multiple
          value={offices}
          onValueChange={setOffices}
        >
          <ComboboxChips ref={anchor}>
            <ComboboxValue>
              {(values: string[]) =>
                values.map((value) => (
                  <ComboboxChip key={value} removeLabel={`Remove ${value}`}>
                    {value}
                  </ComboboxChip>
                ))
              }
            </ComboboxValue>
            <ComboboxChipsInput
              id="combobox-offices"
              placeholder={offices.length ? '' : 'Add a city'}
            />
          </ComboboxChips>
          <ComboboxContent anchor={anchor}>
            <ComboboxEmpty>No city matches.</ComboboxEmpty>
            <ComboboxList>
              {(item: string) => (
                <ComboboxItem key={item} value={item}>
                  {item}
                </ComboboxItem>
              )}
            </ComboboxList>
          </ComboboxContent>
        </Combobox>
        <FieldDescription>{offices.length} chosen</FieldDescription>
      </Field>
    </div>
  );
}
```

## Usage

```tsx
import {
  Combobox,
  ComboboxContent,
  ComboboxEmpty,
  ComboboxInput,
  ComboboxItem,
  ComboboxList,
} from '@workspace/active-ui/components/primitives/combobox';

<Combobox items={cities} value={city} onValueChange={setCity}>
  <ComboboxInput placeholder="Search a city" aria-label="City" />
  <ComboboxContent>
    <ComboboxEmpty>No city matches.</ComboboxEmpty>
    <ComboboxList>
      {(item: string) => (
        <ComboboxItem key={item} value={item}>
          {item}
        </ComboboxItem>
      )}
    </ComboboxList>
  </ComboboxContent>
</Combobox>;
```

## How filtering works

- `items` is the whole list. The combobox filters it against the typed text and passes each match
  to the **function child** of `ComboboxList`, which renders it. Without `items`, there is nothing
  to filter.
- For objects, the text of an item is its `label`, or what `itemToStringLabel` returns; compare
  objects with `isItemEqualToValue`.
- The default filter matches case-insensitively with the browser's collator. Pass `filter` for a
  rule of your own, or build one with `ComboboxPrimitive.useFilter` from Base UI with the
  reader's `locale`.
- `ComboboxEmpty` shows its children only when nothing matches, and is a polite live region.

## Types

`Combobox` is generic: `Combobox<Value, Multiple = false, Item = Value>`. `items` is a list of
`Item`; with one value, `value` is a `Value` or `null` and `onValueChange` receives the same; with
`multiple`, both are a `Value[]`. The function child of `ComboboxList` receives an `Item`.
TypeScript infers the type from `items` and `value`, or you name it: `<Combobox<Airport> …>`. The
API list below keeps these type parameters: `value` is `ComboboxInputValue<Value, Multiple>`, `filter`
receives an `Item`. Where it shows `any`, the type comes that way from Base UI: `items` also accepts
`readonly any[]` and groups of `any`, and the `value` of a `ComboboxItem` and the `items` of a
`ComboboxGroup` are `any`. Those places are not checked against your type; the example shows the
contract with a real one.

**Example: Objects, typed: items, value and callback share one type**

Client: Runs entirely in your browser. Source: `examples/ui/combobox-objects.tsx`.

```tsx
// apps/docs/examples/ui/combobox-objects.tsx
'use client';

import {useState} from 'react';

import {
  Combobox,
  ComboboxContent,
  ComboboxEmpty,
  ComboboxInput,
  ComboboxItem,
  ComboboxList,
} from '@workspace/active-ui/components/primitives/combobox';
import {
  Field,
  FieldDescription,
  FieldLabel,
} from '@workspace/active-ui/components/primitives/field';

interface Airport {
  code: string;
  label: string;
}

const AIRPORTS: readonly Airport[] = [
  {code: 'AMS', label: 'Amsterdam Schiphol'},
  {code: 'BRU', label: 'Brussels'},
  {code: 'CDG', label: 'Paris Charles de Gaulle'},
  {code: 'FRA', label: 'Frankfurt'},
  {code: 'LIS', label: 'Lisbon'},
];

/**
 * The generic contract with objects: `Combobox<Airport>` ties `items`, the
 * `value`, the argument of `onValueChange` and the function child of
 * `ComboboxList` to one type. The text shown and filtered is the `label`;
 * `isItemEqualToValue` compares by code, so a value from elsewhere (a form,
 * the server) matches its item.
 */
export default function ComboboxObjectsExample() {
  const [airport, setAirport] = useState<Airport | null>(null);
  return (
    <Field className="w-full max-w-sm">
      <FieldLabel htmlFor="combobox-airport">Departure</FieldLabel>
      <Combobox<Airport>
        items={AIRPORTS}
        value={airport}
        onValueChange={(next) => setAirport(next)}
        isItemEqualToValue={(item, value) => item.code === value.code}
      >
        <ComboboxInput
          id="combobox-airport"
          placeholder="Search an airport"
          triggerLabel="Show airports"
        />
        <ComboboxContent>
          <ComboboxEmpty>No airport matches.</ComboboxEmpty>
          <ComboboxList>
            {(item: Airport) => (
              <ComboboxItem key={item.code} value={item}>
                {item.label} ({item.code})
              </ComboboxItem>
            )}
          </ComboboxList>
        </ComboboxContent>
      </Combobox>
      <FieldDescription>
        {airport ? `Chosen: ${airport.code}` : 'Nothing chosen.'}
      </FieldDescription>
    </Field>
  );
}
```

## One value or several

- **One value:** `ComboboxInput` is the field. `showClear` adds a clear button, which needs a
  `clearLabel`. `showTrigger` (default `true`) shows the chevron that opens the list: give it a
  `triggerLabel` to make it a named button for the keyboard too; without one it serves the
  pointer only, and the input opens the list with `↓`.
- **Several values:** pass `multiple`. `ComboboxChips` is the field, holding a `ComboboxChip` per
  value (through `ComboboxValue`, which hands you the values) and a `ComboboxChipsInput` to type
  in. Anchor the popup to the chips with `useComboboxAnchor()`: pass the ref to `ComboboxChips` and
  to `anchor` of `ComboboxContent`. A chip has a remove button unless `showRemove={false}`; it
  needs a `removeLabel`.
- `ComboboxGroup` with `ComboboxLabel`, `ComboboxCollection` and `ComboboxSeparator` group the
  items.

## What your application provides

- A label for the input (`id` with a `FieldLabel`, or `aria-label`), and the accessible names of
  the chevron, clear and remove buttons; the package has no English defaults.
- The list, its labels and the value.
- The text for no matches.

## Accessibility and keyboard

- The input has `role="combobox"`; typing opens the list. `↓` and `↑` move through the matches,
  `Enter` chooses and `Escape` closes the list; the clear button empties the value.
- In multiple mode, `Backspace` in an empty input removes the last chip.
- The matches are announced as you move; the chosen item carries `aria-selected`.

## API

### Combobox

| Prop | Type | Required | Description |
| --- | --- | --- | --- |
| `actionsRef` | `RefObject<AriaCombobox.Actions \| null>` | no | A ref to imperative actions. - `unmount`: Ends the closing phase of the combobox after an externally controlled closing animation finishes. Call `preventUnmountOnClose()` in `onOpenChange` first, otherwise the combobox completes closing on its own. Whether it leaves the DOM is decided by `keepMounted` on the portal. - `close`: Closes the combobox imperatively when called. |
| `autoComplete` | `string` | no | Provides a hint to the browser for autofill. |
| `autoHighlight` | `boolean` | no | Whether the first matching item is highlighted automatically while filtering. |
| `children` | `ReactNode` | no |  |
| `defaultInputValue` | `string \| number \| readonly string[]` | no | The uncontrolled input value when initially rendered.  To render a controlled input, use the `inputValue` prop instead. |
| `defaultOpen` | `boolean` | no | Whether the popup is initially open.  To render a controlled popup, use the `open` prop instead. |
| `defaultValue` | `ComboboxInputValue<Value, Multiple> \| null` | no | The uncontrolled selected value of the combobox when it's initially rendered.  To render a controlled combobox, use the `value` prop instead. |
| `disabled` | `boolean` | no | Whether the component should ignore user interaction. |
| `filter` | `((item: Item, query: string, itemToString?: ((item: Item) => string) \| undefined) => boolean) \| null` | no | Filter function used to match items vs input query. Receives the source item, which is the derived value's item when `items` is a `createItems()` collection, and the item itself otherwise. |
| `filteredItems` | `readonly Item[] \| readonly Group<Item>[]` | no | Filtered items to display in the list. When provided, the list uses these items instead of filtering the `items` prop internally. When `items` is also provided, this array must preserve its flat or grouped structure. With a `createItems()` collection, pass source items rather than derived values. Nullish entries are not supported, as in `items`. Use when you want to control filtering logic externally with the `useFilter()` hook. |
| `form` | `string` | no | Identifies the form that owns the internal input. Useful when the combobox is rendered outside the form. |
| `grid` | `boolean` | no | Whether list items are presented in a grid layout. When enabled, arrow keys navigate across rows and columns inferred from DOM rows. |
| `highlightItemOnHover` | `boolean` | no | Whether moving the pointer over items should highlight them. Disabling this prop allows CSS `:hover` to be differentiated from the `:focus` (`data-highlighted`) state. |
| `id` | `string` | no | The id of the component. |
| `inline` | `boolean` | no | Whether the list is rendered inline without using the component's own popup.  Specify `open` unconditionally in conjunction with this prop so the list is considered visible: `<Combobox.Root inline open>`  In a `Combobox.Root` > `Dialog.Root` composition, bind the Combobox's `open` and `onOpenChange` props to the `Dialog`'s `open` and `onOpenChange` state instead so the component resets its transient state (filter query, highlighted item, and input value) when the dialog closes. |
| `inputRef` | `Ref<HTMLInputElement>` | no | A ref to the hidden input element. |
| `inputValue` | `string \| number \| readonly string[]` | no | The input value of the combobox. Use when controlled. |
| `isItemEqualToValue` | `((itemValue: Value, value: Value) => boolean)` | no | Custom comparison logic used to determine if a combobox item value matches the current selected value. Useful when item values are objects without matching referentially. With a `createItems()` collection, both arguments are derived values. Defaults to `Object.is` comparison. |
| `items` | `ComboboxItemCollection<Item, Value> \| readonly any[] \| readonly Group<any>[]` | no | The items to be displayed in the list. Can be a flat array of items, an array of groups with items, or a collection created by the `createItems()` function, which derives each item's selection value and label. Nullish entries are not supported: remove them from the data before passing it. |
| `itemToStringLabel` | `((itemValue: Value) => string)` | no | When the item values are objects (`<Combobox.Item value={object}>`), this function converts the object value to a string representation for display in the input. If the shape of the object is `{ value, label }`, the label will be used automatically without needing to specify this prop. With a `createItems()` collection, this receives the derived value, and the collection's `getLabel` takes precedence for values it can resolve. |
| `itemToStringValue` | `((itemValue: Value) => string)` | no | When the item values are objects (`<Combobox.Item value={object}>`), this function converts the object value to a string representation for form submission. If the shape of the object is `{ value, label }`, the value will be used automatically without needing to specify this prop. With a `createItems()` collection, this receives the derived value. |
| `limit` | `number` | no | The maximum number of items to display in the list. |
| `locale` | `Intl.LocalesArgument` | no | The locale to use for string comparison. Defaults to the user's runtime locale. |
| `loopFocus` | `boolean` | no | Whether to loop keyboard focus back to the input when the end of the list is reached while using the arrow keys. The first item can then be reached by pressing <kbd>ArrowDown</kbd> again from the input, or the last item can be reached by pressing <kbd>ArrowUp</kbd> from the input. The input is always included in the focus loop per [ARIA Authoring Practices](https://www.w3.org/WAI/ARIA/apg/patterns/combobox/). When disabled, focus does not move when on the last element and the user presses <kbd>ArrowDown</kbd>, or when on the first element and the user presses <kbd>ArrowUp</kbd>. |
| `modal` | `boolean` | no | Determines if the popup enters a modal state when open. - `true`: user interaction is limited to the popup: document page scroll is locked and pointer interactions on outside elements are disabled. - `false`: user interaction with the rest of the document is allowed.  On touch devices, a `true` modal blocks outside taps but leaves the page scrollable unless the popup spans nearly the full viewport width, matching native iOS behavior. |
| `multiple` | `Multiple` | no | Whether multiple items can be selected. |
| `name` | `string` | no | Identifies the field when a form is submitted. |
| `onInputValueChange` | `((inputValue: string, eventDetails: ComboboxRoot.ChangeEventDetails) => void)` | no | Event handler called when the input value changes. |
| `onItemHighlighted` | `((highlightedValue: Value \| undefined, eventDetails: ComboboxRoot.HighlightEventDetails) => void)` | no | Callback fired when an item is highlighted or unhighlighted. Receives the highlighted item value (or `undefined` if no item is highlighted) and event details with a `reason` property describing why the highlight changed. The `reason` can be: - `'keyboard'`: the highlight changed due to keyboard navigation. - `'pointer'`: the highlight changed due to pointer hovering. The event may be a `MouseEvent` rather than a `PointerEvent`. - `'none'`: the highlight changed for another reason, such as typing, `autoHighlight`, the item list changing, or the popup opening or closing. |
| `onOpenChange` | `((open: boolean, eventDetails: ComboboxRoot.OpenChangeEventDetails) => void)` | no | Event handler called when the popup is opened or closed. |
| `onOpenChangeComplete` | `((open: boolean) => void)` | no | Event handler called after any animations complete when the popup is opened or closed. |
| `onValueChange` | `((value: ComboboxOutputValue<Value, Multiple> \| (Multiple extends true ? never : null), eventDetails: ComboboxRoot.ChangeEventDetails) => void)` | no | Event handler called when the selected value of the combobox changes. |
| `open` | `boolean` | no | Whether the popup is currently open. Use when controlled. |
| `openOnInputClick` | `boolean` | no | Whether the popup opens when clicking the input. |
| `readOnly` | `boolean` | no | Whether the user should be unable to choose a different option from the popup. |
| `required` | `boolean` | no | Whether the user must choose a value before submitting a form. |
| `value` | `ComboboxInputValue<Value, Multiple> \| null` | no | The selected value of the combobox. Use when controlled. |
| `virtualized` | `boolean` | no | Whether the items are being externally virtualized. |

### ComboboxInput

| Prop | Type | Required | Description |
| --- | --- | --- | --- |
| `clearLabel` | `string` | no | The accessible name of the clear button; required with it. |
| `showClear` | `boolean` | no | Whether a button that clears the value is shown. |
| `showTrigger` | `boolean` | no | Whether the chevron button that opens the list is shown. |
| `triggerLabel` | `string` | no | The accessible name of the chevron button, such as "Show cities". With it the button is a named tab stop; without it the button is for the pointer only: out of the tab order and hidden from assistive technology, since the input itself opens the list with the arrow keys. |
| `disabled` | `boolean` | no | Whether the component should ignore user interaction. |
| `render` | `ComponentRenderFn<HTMLProps, ComboboxInputState> \| ReactElement<unknown, string \| JSXElementConstructor<any>>` | no | Allows you to replace the component's HTML element with a different tag, or compose it with another component.  Accepts a `ReactElement` or a function that returns the element to render. |

### Other parts

**ComboboxContent**

| Prop | Type | Required | Description |
| --- | --- | --- | --- |
| `align` | `Align` | no | How to align the popup relative to the specified side. |
| `alignOffset` | `number \| OffsetFunction` | no | Additional offset along the alignment axis in pixels. Also accepts a function that returns the offset to read the dimensions of the anchor and positioner elements, along with its side and alignment.  The function takes a `data` object parameter with the following properties: - `data.anchor`: the dimensions of the anchor element with properties `width` and `height`. - `data.positioner`: the dimensions of the positioner element with properties `width` and `height`. - `data.side`: which side of the anchor element the positioner is aligned against. - `data.align`: how the positioner is aligned relative to the specified side. |
| `anchor` | `Element \| RefObject<Element \| null> \| VirtualElement \| (() => Element \| VirtualElement \| null) \| null` | no | An element to position the popup against. By default, the popup will be positioned against the trigger. |
| `finalFocus` | `boolean \| RefObject<HTMLElement \| null> \| ((closeType: InteractionType) => void \| boolean \| HTMLElement \| null)` | no | Determines the element to focus when the popup is closed.  - `false`: Do not move focus. - `true`: Move focus based on the default behavior (trigger or previously focused element). - `RefObject`: Move focus to the ref element. - `function`: Called with the interaction type (`mouse`, `touch`, `pen`, or `keyboard`). Return an element to focus, `true` to use the default behavior, or `false`/`undefined` to do nothing. |
| `initialFocus` | `boolean \| RefObject<HTMLElement \| null> \| ((openType: InteractionType) => void \| boolean \| HTMLElement \| null)` | no | Determines the element to focus when the popup is opened.  - `false`: Do not move focus. - `true`: Move focus based on the default behavior (first tabbable element or popup). - `RefObject`: Move focus to the ref element. - `function`: Called with the interaction type (`mouse`, `touch`, `pen`, or `keyboard`). Return an element to focus, `true` to use the default behavior, or `false`/`undefined` to do nothing. |
| `render` | `ComponentRenderFn<HTMLProps, ComboboxPopupState> \| ReactElement<unknown, string \| JSXElementConstructor<any>>` | no | Allows you to replace the component's HTML element with a different tag, or compose it with another component.  Accepts a `ReactElement` or a function that returns the element to render. |
| `side` | `Side` | no | Which side of the anchor element to align the popup against. May automatically change to avoid collisions. |
| `sideOffset` | `number \| OffsetFunction` | no | Distance between the anchor and the popup in pixels. Also accepts a function that returns the distance to read the dimensions of the anchor and positioner elements, along with its side and alignment.  The function takes a `data` object parameter with the following properties: - `data.anchor`: the dimensions of the anchor element with properties `width` and `height`. - `data.positioner`: the dimensions of the positioner element with properties `width` and `height`. - `data.side`: which side of the anchor element the positioner is aligned against. - `data.align`: how the positioner is aligned relative to the specified side. |

**ComboboxList**

| Prop | Type | Required | Description |
| --- | --- | --- | --- |
| `children` | `((item: any, index: number) => ReactNode) \| ReactNode` | no |  |
| `render` | `ComponentRenderFn<HTMLProps, ComboboxListState> \| ReactElement<unknown, string \| JSXElementConstructor<any>>` | no | Allows you to replace the component's HTML element with a different tag, or compose it with another component.  Accepts a `ReactElement` or a function that returns the element to render. |

**ComboboxItem**

| Prop | Type | Required | Description |
| --- | --- | --- | --- |
| `children` | `ReactNode` | no |  |
| `disabled` | `boolean` | no | Whether the component should ignore user interaction. |
| `index` | `number` | no | The index of the item in the list. Improves performance when specified by avoiding the need to calculate the index automatically from the DOM. |
| `nativeButton` | `boolean` | no | Whether the component renders a native `<button>` element when replacing it via the `render` prop. Set to `true` if the rendered element is a native button. |
| `onClick` | `((event: BaseUIEvent<MouseEvent<HTMLDivElement, MouseEvent>>) => void)` | no | An optional click handler for the item when selected. It fires when clicking the item with the pointer, as well as when pressing `Enter` with the keyboard if the item is highlighted when the `Input` or `List` element has focus. |
| `render` | `ComponentRenderFn<HTMLProps, ComboboxItemState> \| ReactElement<unknown, string \| JSXElementConstructor<any>>` | no | Allows you to replace the component's HTML element with a different tag, or compose it with another component.  Accepts a `ReactElement` or a function that returns the element to render. |
| `value` | `any` | no | A unique value that identifies this item. |

**ComboboxGroup**

| Prop | Type | Required | Description |
| --- | --- | --- | --- |
| `items` | `readonly any[]` | no | Items to be rendered within this group. When provided, child `Collection` components will use these items. |
| `render` | `ComponentRenderFn<HTMLProps, ComboboxGroupState> \| ReactElement<unknown, string \| JSXElementConstructor<any>>` | no | Allows you to replace the component's HTML element with a different tag, or compose it with another component.  Accepts a `ReactElement` or a function that returns the element to render. |

**ComboboxLabel**

| Prop | Type | Required | Description |
| --- | --- | --- | --- |
| `render` | `ComponentRenderFn<HTMLProps, ComboboxGroupLabelState> \| ReactElement<unknown, string \| JSXElementConstructor<any>>` | no | Allows you to replace the component's HTML element with a different tag, or compose it with another component.  Accepts a `ReactElement` or a function that returns the element to render. |

**ComboboxCollection**

| Prop | Type | Required | Description |
| --- | --- | --- | --- |
| `children` | `(item: any, index: number) => ReactNode` | yes |  |

**ComboboxEmpty**

| Prop | Type | Required | Description |
| --- | --- | --- | --- |
| `render` | `ComponentRenderFn<HTMLProps, ComboboxEmptyState> \| ReactElement<unknown, string \| JSXElementConstructor<any>>` | no | Allows you to replace the component's HTML element with a different tag, or compose it with another component.  Accepts a `ReactElement` or a function that returns the element to render. |

**ComboboxSeparator**

| Prop | Type | Required | Description |
| --- | --- | --- | --- |
| `orientation` | `Orientation` | no | The orientation of the separator. |
| `render` | `ComponentRenderFn<HTMLProps, ComboboxSeparatorState> \| ReactElement<unknown, string \| JSXElementConstructor<any>>` | no | Allows you to replace the component's HTML element with a different tag, or compose it with another component.  Accepts a `ReactElement` or a function that returns the element to render. |

**ComboboxChips**

| Prop | Type | Required | Description |
| --- | --- | --- | --- |
| `render` | `ComponentRenderFn<HTMLProps, ComboboxChipsState> \| ReactElement<unknown, string \| JSXElementConstructor<any>>` | no | Allows you to replace the component's HTML element with a different tag, or compose it with another component.  Accepts a `ReactElement` or a function that returns the element to render. |

**ComboboxChip**

| Prop | Type | Required | Description |
| --- | --- | --- | --- |
| `removeLabel` | `string` | no | The accessible name of that button, such as "Remove Utrecht". |
| `showRemove` | `boolean` | no | Whether the chip has a button that removes its value. |
| `render` | `ComponentRenderFn<HTMLProps, ComboboxChipState> \| ReactElement<unknown, string \| JSXElementConstructor<any>>` | no | Allows you to replace the component's HTML element with a different tag, or compose it with another component.  Accepts a `ReactElement` or a function that returns the element to render. |

**ComboboxChipsInput**

| Prop | Type | Required | Description |
| --- | --- | --- | --- |
| `disabled` | `boolean` | no | Whether the component should ignore user interaction. |
| `render` | `ComponentRenderFn<HTMLProps, ComboboxInputState> \| ReactElement<unknown, string \| JSXElementConstructor<any>>` | no | Allows you to replace the component's HTML element with a different tag, or compose it with another component.  Accepts a `ReactElement` or a function that returns the element to render. |

**ComboboxTrigger**

| Prop | Type | Required | Description |
| --- | --- | --- | --- |
| `disabled` | `boolean` | no | Whether the component should ignore user interaction. |
| `nativeButton` | `boolean` | no | Whether the component renders a native `<button>` element when replacing it via the `render` prop. Set to `false` if the rendered element is not a button (for example, `<div>`). |
| `render` | `ComponentRenderFn<HTMLProps, ComboboxTriggerState> \| ReactElement<unknown, string \| JSXElementConstructor<any>>` | no | Allows you to replace the component's HTML element with a different tag, or compose it with another component.  Accepts a `ReactElement` or a function that returns the element to render. |

**ComboboxValue**

| Prop | Type | Required | Description |
| --- | --- | --- | --- |
| `children` | `((selectedValue: any) => ReactNode) \| ReactNode` | no | Accepts a function that returns a `ReactNode` to format the selected value. Treat the value as read-only: in `multiple` mode it may be a shared frozen array when nothing is selected. |
| `placeholder` | `ReactNode` | no | The placeholder value to display when no value is selected. This is overridden by `children` if specified, or by a null item's label in `items`. |

**useComboboxAnchor**: `() => RefObject<HTMLDivElement \| null>`

A ref for the element the popup is anchored to. In multiple mode, pass it
to `ComboboxChips` and to `anchor` of `ComboboxContent`, so the list opens
below the whole field of chips instead of below the input.

Returns an object with:

| Prop | Type | Required | Description |
| --- | --- | --- | --- |
| `current` | `HTMLDivElement \| null` | yes | The current value of the ref. |

> [!NOTE]
> **Based on shadcn/ui**
>
> This page adapts the Combobox documentation of shadcn/ui (MIT licence) to this
> package; see [Third-party notices](/third-party-notices).
