# Combo Box

> Filterable combo box — type to search, pick from a list.

Registry name: `combo-box`. HTML docs: https://ui.anuragroy.dev/component/combo-box.

## Install

```bash
npx shadcn@latest add https://ui.anuragroy.dev/r/combo-box.json
```

If the website is down: `npx shadcn@latest add https://raw.githubusercontent.com/anurag-roy/ui.anuragroy.dev/main/public/r/combo-box.json`.

Registry JSON: https://ui.anuragroy.dev/r/combo-box.json (GitHub: https://raw.githubusercontent.com/anurag-roy/ui.anuragroy.dev/main/public/r/combo-box.json).

## Import

Import paths follow the consumer `components.json` aliases. After a default install:

```tsx
import {
  ComboBox,
  ComboBoxContent,
  ComboBoxEmpty,
  ComboBoxInput,
  ComboBoxInputGroup,
  ComboBoxItem,
  ComboBoxLabel,
  ComboBoxList,
  ComboBoxTrigger
} from "@/components/ui/combo-box"
```

## Usage

```tsx
import {
  ComboBox,
  ComboBoxContent,
  ComboBoxEmpty,
  ComboBoxInput,
  ComboBoxInputGroup,
  ComboBoxItem,
  ComboBoxLabel,
  ComboBoxList,
  ComboBoxTrigger,
} from "@/components/ui/combo-box"

const items = ["Next.js", "Remix", "Astro"]

export function Example() {
  return (
    <ComboBox items={items}>
      <ComboBoxLabel>Framework</ComboBoxLabel>
      <ComboBoxInputGroup>
        <ComboBoxInput placeholder="Select…" />
        <ComboBoxTrigger />
      </ComboBoxInputGroup>
      <ComboBoxContent>
        <ComboBoxEmpty>No frameworks</ComboBoxEmpty>
        <ComboBoxList>
          {(item: string) => (
            <ComboBoxItem key={item} value={item}>
              {item}
            </ComboBoxItem>
          )}
        </ComboBoxList>
      </ComboBoxContent>
    </ComboBox>
  )
}
```

## API

### ComboBox

Base UI Combobox root. `items` can be strings or objects.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `items` | readonly Item[] | — |  |
| `onValueChange` | (value) => void | — |  |

## Notes

- Chip and multi-select helpers (`ComboBoxChips`, `ComboBoxChip`) are also exported.

## See also

- [HTML page](https://ui.anuragroy.dev/component/combo-box): Preview and the same docs in the site chrome.
- [Registry item](https://ui.anuragroy.dev/r/combo-box.json): Source files and dependencies.
- [Catalog](https://ui.anuragroy.dev/component): All components.
- [llms.txt](https://ui.anuragroy.dev/llms.txt): Agent index for this library.
