> ## Documentation Index
> Fetch the complete documentation index at: https://npm-packages.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Combobox

> Filter a list, select several labels, and remove them as chips.

Package: [`@base-ui/react`](https://www.npmjs.com/package/@base-ui/react).

## Try it

Type **doc** to narrow the options. Add Documentation, remove a chip, then search for **zzz** to see the empty state.

## Code

```tsx base-ui-combobox.tsx theme={"theme":{"light":"github-light","dark":"github-dark"}}
import { Combobox } from "@base-ui/react/combobox";
import { useState } from "react";

import { DemoIcon } from "./demo-icons.tsx";
import "./base-ui-example.css";

const labels = ["Design", "Documentation", "Engineering", "Feedback", "Research", "Writing"];

export function BaseUiCombobox() {
  const [selected, setSelected] = useState<string[]>(["Design", "Engineering"]);

  return (
    <div className="base-ui-example base-ui-combobox-demo">
      <Combobox.Root items={labels} multiple value={selected} onValueChange={setSelected}>
        <Combobox.Label className="base-ui-example-label">Project labels</Combobox.Label>
        <Combobox.InputGroup className="base-ui-combobox-group">
          <Combobox.Value>
            {(values: string[]) => (
              <Combobox.Chips className="base-ui-combobox-chips" aria-label="Selected labels">
                {values.map((label) => (
                  <Combobox.Chip
                    key={label}
                    className="base-ui-combobox-chip"
                    aria-label={label}
                    aria-description="Press Backspace or Delete to remove"
                  >
                    {label}
                    <Combobox.ChipRemove
                      className="base-ui-chip-remove"
                      aria-label={`Remove ${label}`}
                    >
                      <DemoIcon name="close" />
                    </Combobox.ChipRemove>
                  </Combobox.Chip>
                ))}
                <Combobox.Input
                  className="base-ui-combobox-input"
                  placeholder="Find a label…"
                  aria-description="Use the arrow keys to navigate labels. Press Arrow Left from an empty input to reach selected labels."
                />
              </Combobox.Chips>
            )}
          </Combobox.Value>
          <Combobox.Trigger className="base-ui-combobox-trigger" aria-label="Show labels">
            <DemoIcon name="chevron-down" />
          </Combobox.Trigger>
        </Combobox.InputGroup>
        <Combobox.Portal>
          <Combobox.Positioner className="base-ui-positioner" sideOffset={6}>
            <Combobox.Popup className="base-ui-popup base-ui-combobox-popup">
              <Combobox.Empty className="base-ui-combobox-empty">
                No matching labels. Try “Design”.
              </Combobox.Empty>
              <Combobox.List className="base-ui-combobox-list">
                {(label: string) => (
                  <Combobox.Item key={label} value={label} className="base-ui-option">
                    <Combobox.ItemIndicator className="base-ui-item-indicator">
                      <DemoIcon name="check" />
                    </Combobox.ItemIndicator>
                    {label}
                  </Combobox.Item>
                )}
              </Combobox.List>
            </Combobox.Popup>
          </Combobox.Positioner>
        </Combobox.Portal>
      </Combobox.Root>
      <p className="base-ui-helper" role="status">
        {selected.length} labels selected.
      </p>
    </div>
  );
}
```

## Keyboard

Use Arrow Up and Arrow Down to move through results, Enter to select, and Escape to close. With an empty input, Arrow Left moves to the chips; Backspace or Delete removes the focused chip.

## Key props

| Prop or part | Purpose |
| - | - |
| `items` | Supply the collection used for filtering and the empty state. |
| `multiple` | Keep several selected values in one combobox. |
| `value` / `onValueChange` | Store the selected labels in React state. |
| `Combobox.ChipRemove` | Remove a selected value while preserving keyboard navigation. |

[Base UI Combobox documentation](https://base-ui.com/react/components/combobox)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.