---
title: "Combobox"
description: "Type to filter a list, then pick one value or several as chips. The value is always one of the items, so it works as a select with search."
url: https://gelatinui.com/components/combobox
markdown_url: https://gelatinui.com/components/combobox.md
access: free
install: "npx shadcn@latest add @gelatin-ui/combobox"
registry_item: https://gelatinui.com/r/combobox.json
version: "2026-11-08"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Combobox

> Type to filter a list, then pick one value or several as chips. The value is always one of the items, so it works as a select with search.

Page: https://gelatinui.com/components/combobox

## When to use it

Best for: Type to filter a list, then pick one value or several from that list.

- Use it when the list is long and the value must be one of its items.
- Use `multiple` with `ComboboxChips` to pick many values.
- Use `filter={null}` when a server does the search.
- Use `createComboboxItems` so the form gets an id and the input shows a label.

## When not to use it

- For free text with suggestions, use an [Autocomplete](https://gelatinui.com/components/autocomplete.md).
- For a short list with no typing, use a [Select](https://gelatinui.com/components/select.md).
- For free text that turns into tags, use a [Tags Input](https://gelatinui.com/components/tags-input.md).
- For values in a tree of levels, use a [Cascader](https://gelatinui.com/components/cascader.md).

## Notes for agents

- `autoHighlight` is on by default, so Enter picks the first match. Pass `autoHighlight={false}` to turn it off.
- Give `ComboboxChips` an `aria-label`, such as "Selected reviewers". It is a toolbar.
- With the input in a frame, use a `FieldLabel` or a `<label>`. Use `ComboboxLabel` only with a field trigger.
- An input in the popup needs `ComboboxTrigger variant="field"`, `ComboboxInput variant="popup"`, and `ComboboxValue`.
- Keyboard users cannot Tab to the `ComboboxTrigger` icon or `ComboboxClear`. Base UI keeps them out of the tab order.
- Translate `ComboboxClear` with its `aria-label`. The default is "Clear".
- `useComboboxAnchor` is only for a popup anchored to chips. A `ComboboxInputGroup` anchors the popup by itself.

## Anatomy

```text
Combobox
├─ ComboboxLabel (0..n)
├─ ComboboxValue (0..n)
├─ ComboboxInputGroup (0..n)
├─ ComboboxInput (0..n)
├─ ComboboxTrigger (0..n)
├─ ComboboxIcon (0..n)
├─ ComboboxClear (0..n)
├─ ComboboxChips (0..n)
├─ ComboboxChipsInput (0..n)
├─ ComboboxChip (0..n)
├─ ComboboxChipRemove (0..n)
├─ ComboboxContent (0..n)
├─ ComboboxList (0..n)
├─ ComboboxItem (0..n)
├─ ComboboxGroup (0..n)
├─ ComboboxGroupLabel (0..n)
├─ ComboboxCollection (0..n)
├─ ComboboxRow (0..n)
├─ ComboboxSeparator (0..n)
├─ ComboboxEmpty (0..n)
└─ ComboboxStatus (0..n)
```

## API reference

### Combobox

Also takes every prop of Base UI `Combobox.Root`: https://base-ui.com/react/components/combobox

### ComboboxInputGroup

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |
| `size` | `ControlSize` | "default" | 24, 28, 32, or 36px: the field sizes of `controlVariants`, the one source. A type from `comboboxInputGroupVariants` would lose its literal values through three `extend` steps. |

### ComboboxInput

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |
| `variant` | `"bare" \| "frame" \| "popup"` | "frame" | `frame` (default): in a `ComboboxInputGroup`. `popup`: the search row at the top of the popup. `bare`: no look, for a `render` field that keeps its own. |

Also takes every prop of Base UI `Combobox.Input`: https://base-ui.com/react/components/combobox

### ComboboxTrigger

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |
| `size` | `ControlSize` |  | 24, 28, 32, or 36px: the field sizes of `controlVariants`. |
| `variant` | `"field" \| "icon"` | "icon" | `icon` (default): the chevron button at the end of a `ComboboxInputGroup`. Its accessible name is `aria-label` ("Show options" by default; translate it). `field`: a Select-like field that shows the value; the input then sits in the popup. |

Also takes every prop of Base UI `Combobox.Trigger`: https://base-ui.com/react/components/combobox

### ComboboxClear

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |

Also takes every prop of Base UI `Combobox.Clear`: https://base-ui.com/react/components/combobox

### ComboboxChipsInput

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |

Also takes every prop of Base UI `Combobox.Input`: https://base-ui.com/react/components/combobox

### ComboboxChip

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |
| `showRemove` | `boolean` | true | Show the remove button (default). Without it, Backspace and Delete still remove the chip. |
| `removeLabel` | `string` |  | The accessible name of the remove button. Default: "Remove " and the text of the chip. |
| `rounded` | `"default" \| "full"` |  |  |

### ComboboxContent

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |
| `arrow` | `boolean` | false | Show an arrow that points at the frame. The gap grows from 4px to 8px. |
| `backdrop` | `boolean` | false | Put a clear layer under the popup (Base UI `Combobox.Backdrop`). |
| `portalProps` | `Omit` |  | Other Base UI props of the inner parts. A `className` here adds to the component classes. |
| `positionerProps` | `PopupPartProps` |  |  |
| `backdropProps` | `PopupPartProps<ComboboxBackdropProps>` |  |  |
| `arrowProps` | `PopupPartProps<ComboboxArrowProps>` |  |  |

Also takes every prop of Base UI `Combobox.Popup`: https://base-ui.com/react/components/combobox

### ComboboxList

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |

Also takes every prop of Base UI `Combobox.List`: https://base-ui.com/react/components/combobox

### ComboboxItem

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |

Also takes every prop of Base UI `Combobox.Item`: https://base-ui.com/react/components/combobox

### ComboboxStatus

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |
| `status` | `DataStatus` | "ready" | The load state of the search. Default `ready`. `loading`: the 16px spinner (the one shared spinner size) before the text. `empty` and `error` show as `ready`: the text says why. |

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| Combobox | `combobox` |  |  |  |
| ComboboxLabel | `combobox-label` |  |  |  |
| ComboboxValue | `combobox-value` |  |  |  |
| ComboboxInputGroup | `combobox-input-group` | `aria-invalid`, `data-chip`, `data-input-group-control`, `data-popup-open` | `--chip-frame-button-offset`, `--spacing` |  |
| ComboboxInput | `combobox-input` | `data-chips`, `data-size` |  |  |
| ComboboxTrigger | `combobox-trigger` | `aria-invalid`, `data-disabled`, `data-placeholder`, `data-popup-open`, `data-readonly` |  |  |
| ComboboxIcon | `combobox-icon` | `data-size` |  |  |
| ComboboxClear | `combobox-clear` | `aria-invalid`, `data-ending-style`, `data-popup-open`, `data-readonly`, `data-starting-style` |  | `motion-timing` |
| ComboboxChips | `combobox-chips` |  |  |  |
| ComboboxChipsInput | `combobox-chips-input` |  |  |  |
| ComboboxChip | `combobox-chip` |  |  |  |
| ComboboxChipRemove | `combobox-chip-remove` |  |  |  |
| ComboboxContent | `combobox-content` |  | `--anchor-width`, `--available-height`, `--available-width` |  |
| ComboboxList | `combobox-list` | `data-empty` |  |  |
| ComboboxItem | `combobox-item` | `data-ending-style`, `data-starting-style` |  | `motion-timing` |
| ComboboxGroup | `combobox-group` |  |  |  |
| ComboboxGroupLabel | `combobox-group-label` |  |  |  |
| ComboboxCollection | `combobox-collection` |  |  |  |
| ComboboxRow | `combobox-row` |  |  |  |
| ComboboxSeparator | `combobox-separator` |  |  |  |
| ComboboxEmpty | `combobox-empty` |  |  |  |
| ComboboxStatus | `combobox-status` |  |  |  |

## Usage

Pass `items` to the root, and render each row from the list function. Add `multiple` and chips for many values.

The sample also uses `field`, which this add does not write. One command adds them with this item:

```bash
npx shadcn@latest add @gelatin-ui/combobox @gelatin-ui/field
```

```tsx title="assignee-field.tsx"
import {
  Combobox,
  ComboboxClear,
  ComboboxContent,
  ComboboxEmpty,
  ComboboxInput,
  ComboboxInputGroup,
  ComboboxItem,
  ComboboxList,
  ComboboxTrigger,
} from "@/components/ui/combobox";
import { Field, FieldLabel } from "@/components/ui/field";

export function AssigneeField({ people }: { people: string[] }) {
  return (
    <Field>
      <FieldLabel>Assignee</FieldLabel>
      <Combobox items={people}>
        <ComboboxInputGroup>
          <ComboboxInput placeholder="Assign to" />
          <ComboboxClear />
          <ComboboxTrigger />
        </ComboboxInputGroup>
        <ComboboxContent>
          <ComboboxEmpty>No people found.</ComboboxEmpty>
          <ComboboxList>
            {(person: string) => {
              return (
                <ComboboxItem key={person} value={person}>
                  {person}
                </ComboboxItem>
              );
            }}
          </ComboboxList>
        </ComboboxContent>
      </Combobox>
    </Field>
  );
}
```

## Compose

Rules:

- Compose the parts (`compose-parts`): Build each item from its named parts as children, and pass your text and icons in as parts.
- Every state is designed (`every-state`): Give each view of data its loading, empty, and error states: a skeleton in the final layout, an `Empty` with an illustration and one next action, and an error that says what failed and how to retry.

## Add it

```bash
npx shadcn@latest add @gelatin-ui/combobox
```

It adds 35 registry items: 32 files, 5602 lines, and the npm packages `@base-ui/react`, `@phosphor-icons/react`, `clsx`, `motion`, `tailwind-merge`, `tailwind-variants`.

## Built on

- [Animated Chevrons Up Down Icon](https://gelatinui.com/components/animated-chevrons-up-down-icon.md)
- [Input Group](https://gelatinui.com/components/input-group.md)
- [Separator](https://gelatinui.com/components/separator.md)
- [Spinner](https://gelatinui.com/components/spinner.md)

## For AI agents

- Every item, one file: https://gelatinui.com/llms.txt
- MCP server (`search_items`, `get_item`, `get_install_plan`): https://gelatinui.com/mcp

## Related

- [Select](https://gelatinui.com/components/select.md): Pick Select for a short list where people pick with no typing.
- [Autocomplete](https://gelatinui.com/components/autocomplete.md): Pick Autocomplete when the typed text itself is the value and the list only suggests.
- [Tags Input](https://gelatinui.com/components/tags-input.md)
- [Command](https://gelatinui.com/components/command.md): Pick Command to run commands from a search field, such as a command palette, not to set a form value.

## Keyboard

| Keys | Action |
| --- | --- |
| Down Arrow, Up Arrow | Opens the list, then moves the highlight. |
| Enter | Picks the highlighted item. |
| Escape | Closes the list. With the list closed, clears the value and the text. |
| Home, End | Moves the caret to the start or the end of the text. |
| Left Arrow | With `multiple`, at the start of the text, moves focus to the last chip. Right to left uses Right Arrow. |
| Backspace | With `multiple`, in an empty input, removes the last chip. |
| Backspace, Delete | On a chip, removes it. |

## Accessibility

The input is a combobox, and the list is a listbox. The active row moves while focus stays in the input.

A `Field` with a `FieldLabel` names the input. The clear and trigger buttons stay out of the tab order.

On a coarse pointer, rows grow to 44px high. The text stays 14px.

## Motion

| Part | Motion |
| --- | --- |
| Open | popup · 150ms · ease-panel (0.2, 0.4, 0.2, 1) · fades in and scales from 95% |
| Close | popup-exit · 120ms · ease-out (0, 0, 0.2, 1) |
