# Combobox

> A searchable input that selects and remembers one or more values.

```tsx title="hero.tsx"
import {
  Combobox,
  ComboboxClear,
  ComboboxEmpty,
  ComboboxInput,
  ComboboxInputGroup,
  ComboboxInputTrigger,
  ComboboxItem,
  ComboboxItemIndicator,
  ComboboxItemText,
  ComboboxList,
  ComboboxPopup,
  ComboboxPortal,
  ComboboxPositioner,
} from '@langgenius/dify-ui/combobox'
import { Field, FieldDescription, FieldLabel } from '@langgenius/dify-ui/field'

type KnowledgeBase = {
  value: string
  label: string
}

const knowledgeBases: KnowledgeBase[] = [
  { value: 'product-docs', label: 'Product documentation' },
  { value: 'api-reference', label: 'API reference' },
  { value: 'release-notes', label: 'Release notes' },
  { value: 'support-tickets', label: 'Support tickets 2026' },
  { value: 'refund-policy', label: 'Refund & billing policy' },
  { value: 'security-faq', label: 'Security & compliance FAQ' },
  { value: 'enterprise-sla', label: 'Enterprise SLA terms' },
  { value: 'sales-playbook', label: 'Sales playbook' },
  { value: 'onboarding-guide', label: 'Customer onboarding guide' },
  { value: 'sdk-migration', label: 'SDK migration guides' },
  { value: 'runbooks', label: 'Troubleshooting runbooks' },
  { value: 'model-benchmarks', label: 'Model provider benchmarks' },
  { value: 'prompt-handbook', label: 'Prompt engineering handbook' },
  { value: 'webhook-schemas', label: 'Webhook payload schemas' },
  { value: 'workspace-admin', label: 'Workspace admin guide' },
  { value: 'privacy-gdpr', label: 'Privacy & GDPR handbook' },
]

export function ComboboxHeroDemo() {
  return (
    <Field name="knowledgeBase" className="w-full max-w-72">
      <FieldLabel>Knowledge base</FieldLabel>
      <Combobox items={knowledgeBases}>
        <ComboboxInputGroup>
          <ComboboxInput placeholder="e.g. Product documentation" />
          <ComboboxClear />
          <ComboboxInputTrigger className="data-popup-open:bg-components-input-bg-hover data-popup-open:text-text-secondary" />
        </ComboboxInputGroup>
        <ComboboxPortal>
          <ComboboxPositioner>
            <ComboboxPopup>
              <ComboboxEmpty>No knowledge base matches.</ComboboxEmpty>
              <ComboboxList<KnowledgeBase>>
                {(knowledgeBase) => (
                  <ComboboxItem key={knowledgeBase.value} value={knowledgeBase}>
                    <ComboboxItemText>{knowledgeBase.label}</ComboboxItemText>
                    <ComboboxItemIndicator />
                  </ComboboxItem>
                )}
              </ComboboxList>
            </ComboboxPopup>
          </ComboboxPositioner>
        </ComboboxPortal>
      </Combobox>
      <FieldDescription>The chatbot answers from this knowledge base.</FieldDescription>
    </Field>
  )
}
```

## Usage guidelines

- Use `Combobox` to select and remember one or more values from a searchable collection. Use `Select` to choose from a closed, scannable list without text entry, and `Autocomplete` for free-form text with optional suggestions, where the value is the typed text.
- Give the input an accessible name. An input-based combobox inside a `Field` takes `FieldLabel`; a trigger-based combobox takes `ComboboxLabel`, and a popup that holds its own search input is named with `aria-label`.
- Pass `items` to the root so filtering, typeahead and `ComboboxValue` share one source of truth. Keep the caller's value type with `Combobox<Value, Multiple, Item>`; in multiple mode the second generic is the literal `true` and matches `multiple`.
- Use `ComboboxClear` to clear the selected value, in the input group outside the popup. When the search input sits inside the popup, do not add a control that clears the typed query: the popup resets the query itself, and a second clear button adds a tab stop that means something other than clearing the selection.
- Render chips through `ComboboxValue` around `ComboboxChips`, and label the chips container only while it has chips and the `toolbar` role. Localize the chip's Backspace/Delete description, each `ComboboxChipRemove` name, and the input's selection count and Left Arrow hint.
- The popup follows the anchor width and clamps to the viewport with Base UI's `--anchor-width` and `--available-width`. Do not replace that sizing with a fixed width.

## Anatomy

```tsx
import {
  Combobox,
  ComboboxChip,
  ComboboxChipRemove,
  ComboboxChips,
  ComboboxClear,
  ComboboxEmpty,
  ComboboxGroup,
  ComboboxGroupLabel,
  ComboboxInput,
  ComboboxInputGroup,
  ComboboxInputTrigger,
  ComboboxItem,
  ComboboxItemIndicator,
  ComboboxItemText,
  ComboboxList,
  ComboboxPopup,
  ComboboxPortal,
  ComboboxPositioner,
  ComboboxStatus,
  ComboboxValue,
} from '@langgenius/dify-ui/combobox'
```

```tsx
<Combobox>
  <ComboboxInputGroup>
    <ComboboxValue>
      <ComboboxChips>
        <ComboboxChip>
          <ComboboxChipRemove />
        </ComboboxChip>
        <ComboboxInput />
      </ComboboxChips>
    </ComboboxValue>
    <ComboboxClear />
    <ComboboxInputTrigger />
  </ComboboxInputGroup>
  <ComboboxPortal>
    <ComboboxPositioner>
      <ComboboxPopup>
        <ComboboxStatus />
        <ComboboxEmpty />
        <ComboboxList>
          <ComboboxGroup>
            <ComboboxGroupLabel />
            <ComboboxItem>
              <ComboboxItemText />
              <ComboboxItemIndicator />
            </ComboboxItem>
          </ComboboxGroup>
        </ComboboxList>
      </ComboboxPopup>
    </ComboboxPositioner>
  </ComboboxPortal>
</Combobox>
```

Chips are for multiple selection only; a single combobox puts `ComboboxInput` directly in the input group. For a select-like field, render `ComboboxLabel` and a `ComboboxTrigger` with `ComboboxValue` and `ComboboxIcon`, and move the input group into `ComboboxPopup`.

## Examples

### Multiple selection with chips

Selected values render as chips that wrap inside the input group, and `ArrowLeft` from the start of the input moves focus onto them. The chip description, the remove button names and the selection hint in `FieldDescription` are your strings to localize.

```tsx title="multiple-chips.tsx"
import {
  Combobox,
  ComboboxChip,
  ComboboxChipRemove,
  ComboboxChips,
  ComboboxEmpty,
  ComboboxInput,
  ComboboxInputGroup,
  ComboboxItem,
  ComboboxItemIndicator,
  ComboboxItemText,
  ComboboxList,
  ComboboxPopup,
  ComboboxPortal,
  ComboboxPositioner,
  ComboboxValue,
} from '@langgenius/dify-ui/combobox'
import { useDirection } from '@langgenius/dify-ui/direction-provider'
import { Field, FieldDescription, FieldLabel } from '@langgenius/dify-ui/field'
import * as React from 'react'

type Member = {
  value: string
  label: string
  role: string
}

const members: Member[] = [
  { value: 'maya', label: 'Maya Chen', role: 'Workspace owner' },
  { value: 'liam', label: 'Liam Brooks', role: 'Prompt engineer' },
  { value: 'nora', label: 'Nora Park', role: 'Data steward' },
  { value: 'owen', label: 'Owen Reed', role: 'Security reviewer' },
  { value: 'yuki', label: 'Yuki Tanaka', role: 'ML engineer' },
  { value: 'elena', label: 'Elena Rossi', role: 'Solutions architect' },
  { value: 'marcus', label: 'Marcus Cole', role: 'Support lead' },
  { value: 'priya', label: 'Priya Nair', role: 'Product manager' },
  { value: 'daniel', label: 'Daniel Kim', role: 'Platform engineer' },
  { value: 'sofia', label: 'Sofia Alvarez', role: 'QA lead' },
  { value: 'lucas', label: 'Lucas Weber', role: 'Docs maintainer' },
  { value: 'hannah', label: 'Hannah Lin', role: 'Compliance officer' },
  { value: 'noah', label: 'Noah Patel', role: 'SRE on-call' },
  { value: 'chloe', label: 'Chloe Laurent', role: 'Frontend engineer' },
  { value: 'mateo', label: 'Mateo Silva', role: 'Backend engineer' },
  { value: 'amara', label: 'Amara Okafor', role: 'Analytics lead' },
]

export function ComboboxMultipleChipsDemo() {
  const [reviewers, setReviewers] = React.useState<Member[]>([members[0]!, members[1]!])
  const direction = useDirection()

  return (
    <Field name="reviewers" className="w-full max-w-80">
      <FieldLabel>Reviewers</FieldLabel>
      <Combobox<Member, true>
        items={members}
        multiple
        value={reviewers}
        onValueChange={setReviewers}
      >
        <ComboboxInputGroup className="items-start py-1">
          <ComboboxValue<Member, true>>
            {(selected) => {
              const selectedMembers = selected ?? []

              return (
                <ComboboxChips
                  aria-label={selectedMembers.length > 0 ? 'Selected reviewers' : undefined}
                >
                  {selectedMembers.map((member) => (
                    <ComboboxChip
                      key={member.value}
                      aria-description="Press Backspace or Delete to remove"
                    >
                      <span className="max-w-32 truncate">{member.label}</span>
                      <ComboboxChipRemove aria-label={`Remove ${member.label}`} />
                    </ComboboxChip>
                  ))}
                  <ComboboxInput placeholder="e.g. Nora Park" className="min-w-24 py-0.5" />
                </ComboboxChips>
              )
            }}
          </ComboboxValue>
        </ComboboxInputGroup>
        <ComboboxPortal>
          <ComboboxPositioner>
            <ComboboxPopup>
              <ComboboxEmpty>No member matches.</ComboboxEmpty>
              <ComboboxList<Member>>
                {(member) => (
                  <ComboboxItem key={member.value} value={member}>
                    <ComboboxItemText>
                      {member.label}{' '}
                      <span className="ms-1 system-xs-regular text-text-tertiary">
                        {member.role}
                      </span>
                    </ComboboxItemText>
                    <ComboboxItemIndicator />
                  </ComboboxItem>
                )}
              </ComboboxList>
            </ComboboxPopup>
          </ComboboxPositioner>
        </ComboboxPortal>
      </Combobox>
      <FieldDescription>
        Reviewers approve changes before the app is published.
        {reviewers.length > 0 && (
          <span className="sr-only">
            {` ${reviewers.length} selected. From the start of the input, press ${direction === 'rtl' ? 'Right' : 'Left'} Arrow to focus the selected reviewers.`}
          </span>
        )}
      </FieldDescription>
    </Field>
  )
}
```

### Grouped options with live status

Pass grouped `{ label, items }` objects to `items` and render them with `ComboboxGroup`, `ComboboxGroupLabel`, `ComboboxSeparator` and `ComboboxCollection`. `ComboboxStatus` announces the filtered result count as the user types.

```tsx title="groups.tsx"
import {
  Combobox,
  ComboboxClear,
  ComboboxCollection,
  ComboboxEmpty,
  ComboboxGroup,
  ComboboxGroupLabel,
  ComboboxInput,
  ComboboxInputGroup,
  ComboboxInputTrigger,
  ComboboxItem,
  ComboboxItemIndicator,
  ComboboxItemText,
  ComboboxList,
  ComboboxPopup,
  ComboboxPortal,
  ComboboxPositioner,
  ComboboxSeparator,
  ComboboxStatus,
  useComboboxFilteredItems,
} from '@langgenius/dify-ui/combobox'
import { Field, FieldDescription, FieldLabel } from '@langgenius/dify-ui/field'
import * as React from 'react'

type WorkflowTool = {
  value: string
  label: string
}

type ToolGroup = {
  label: string
  items: WorkflowTool[]
}

const toolGroups: ToolGroup[] = [
  {
    label: 'Search & web',
    items: [
      { value: 'web-search', label: 'Web search' },
      { value: 'firecrawl', label: 'Firecrawl scraper' },
      { value: 'jina-reader', label: 'Jina Reader' },
      { value: 'wikipedia', label: 'Wikipedia lookup' },
    ],
  },
  {
    label: 'Knowledge & files',
    items: [
      { value: 'doc-extractor', label: 'Document extractor' },
      { value: 'pdf-parser', label: 'PDF table parser' },
      { value: 'notion-sync', label: 'Notion reader' },
      { value: 'gdrive-fetch', label: 'Google Drive fetcher' },
    ],
  },
  {
    label: 'Communication',
    items: [
      { value: 'slack-post', label: 'Slack message' },
      { value: 'lark-bot', label: 'Lark webhook' },
      { value: 'email-send', label: 'Email sender' },
      { value: 'pagerduty', label: 'PagerDuty alert' },
    ],
  },
  {
    label: 'Developer tools',
    items: [
      { value: 'github-issue', label: 'GitHub issue' },
      { value: 'linear-ticket', label: 'Linear ticket' },
      { value: 'postgres-query', label: 'PostgreSQL query' },
      { value: 'http-webhook', label: 'HTTP webhook' },
    ],
  },
]

function GroupedToolList() {
  const groups = useComboboxFilteredItems<ToolGroup>()
  const matchCount = groups.reduce((total, group) => total + group.items.length, 0)

  return (
    <React.Fragment>
      <ComboboxStatus className="border-b-[0.5px] border-divider-subtle py-1.5 system-xs-regular tabular-nums">
        {matchCount > 0 ? `${matchCount} ${matchCount === 1 ? 'tool' : 'tools'}` : ''}
      </ComboboxStatus>
      <ComboboxEmpty>No workflow tool matches.</ComboboxEmpty>
      <ComboboxList<ToolGroup>>
        {(group, index) => (
          <ComboboxGroup<WorkflowTool> key={group.label} items={group.items}>
            {index > 0 && <ComboboxSeparator />}
            <ComboboxGroupLabel>{group.label}</ComboboxGroupLabel>
            <ComboboxCollection<WorkflowTool>>
              {(tool) => (
                <ComboboxItem<WorkflowTool> key={tool.value} value={tool}>
                  <ComboboxItemText>{tool.label}</ComboboxItemText>
                  <ComboboxItemIndicator />
                </ComboboxItem>
              )}
            </ComboboxCollection>
          </ComboboxGroup>
        )}
      </ComboboxList>
    </React.Fragment>
  )
}

export function ComboboxGroupsDemo() {
  return (
    <Field name="workflowTool" className="w-full max-w-72">
      <FieldLabel>Workflow tool</FieldLabel>
      <Combobox items={toolGroups}>
        <ComboboxInputGroup>
          <ComboboxInput placeholder="e.g. Web search" />
          <ComboboxClear />
          <ComboboxInputTrigger className="data-popup-open:bg-components-input-bg-hover data-popup-open:text-text-secondary" />
        </ComboboxInputGroup>
        <ComboboxPortal>
          <ComboboxPositioner>
            <ComboboxPopup>
              <GroupedToolList />
            </ComboboxPopup>
          </ComboboxPositioner>
        </ComboboxPortal>
      </Combobox>
      <FieldDescription>Empty groups hide automatically as you filter.</FieldDescription>
    </Field>
  )
}
```

### ID values with a popup search input

`createComboboxItems` keeps full records for the list while the value stays a stable ID. `getLabel` drives filtering and the trigger text. An unpublished app is a disabled item: it stays visible but cannot be chosen. `ComboboxClear` sits beside the trigger to clear the selected value, while the search input inside the popup has no clear button of its own.

```tsx title="item-ids.tsx"
import { Button } from '@langgenius/dify-ui/button'
import {
  Combobox,
  ComboboxClear,
  ComboboxEmpty,
  ComboboxIcon,
  ComboboxInput,
  ComboboxInputGroup,
  ComboboxItem,
  ComboboxItemIndicator,
  ComboboxItemText,
  ComboboxLabel,
  ComboboxList,
  ComboboxPopup,
  ComboboxPortal,
  ComboboxPositioner,
  ComboboxTrigger,
  ComboboxValue,
  createComboboxItems,
} from '@langgenius/dify-ui/combobox'
import * as React from 'react'

type App = {
  id: string
  name: string
  mode: string
  published: boolean
}

const apps: App[] = [
  { id: 'app_3f9a', name: 'Customer support bot', mode: 'Chatflow', published: true },
  { id: 'app_81c2', name: 'Invoice extractor', mode: 'Workflow', published: true },
  { id: 'app_5d0e', name: 'Release note writer', mode: 'Completion', published: true },
  { id: 'app_c47b', name: 'Research agent', mode: 'Agent', published: false },
  { id: 'app_9e16', name: 'Meeting summarizer', mode: 'Workflow', published: true },
  {
    id: 'app_7a42',
    name: 'Enterprise contract compliance reviewer',
    mode: 'Workflow',
    published: true,
  },
  { id: 'app_2b80', name: 'Sales lead qualifier', mode: 'Chatflow', published: true },
  { id: 'app_6d19', name: 'SQL query assistant', mode: 'Agent', published: true },
  { id: 'app_e305', name: 'Changelog translator', mode: 'Completion', published: true },
  { id: 'app_4f61', name: 'Bug report triager', mode: 'Workflow', published: true },
  { id: 'app_b094', name: 'Onboarding concierge', mode: 'Chatflow', published: true },
  { id: 'app_1c38', name: 'Incident postmortem drafter', mode: 'Completion', published: false },
  { id: 'app_94de', name: 'Knowledge gap detector', mode: 'Workflow', published: true },
  { id: 'app_58a3', name: 'RFP response builder', mode: 'Agent', published: true },
  { id: 'app_a72f', name: 'Support ticket router', mode: 'Workflow', published: true },
  { id: 'app_d18c', name: 'API docs helper', mode: 'Chatflow', published: true },
]

const appItems = createComboboxItems(apps, {
  getValue: (app) => app.id,
  getLabel: (app) => app.name,
})

export function ComboboxItemIdsDemo() {
  const [appId, setAppId] = React.useState<string | null>('app_81c2')

  return (
    <div className="flex w-full max-w-72 flex-col gap-1">
      <Combobox<string, false, App> items={appItems} value={appId} onValueChange={setAppId}>
        <ComboboxLabel>Fallback app</ComboboxLabel>
        <div className="flex items-center gap-1">
          <ComboboxTrigger
            render={
              <Button
                variant="secondary"
                className="min-w-0 flex-1 justify-between data-popup-open:bg-components-button-secondary-bg-hover data-popup-open:inset-ring-components-button-secondary-border-hover"
              />
            }
          >
            <span className="min-w-0 truncate">
              <ComboboxValue placeholder="Select an app" />
            </span>
            <ComboboxIcon />
          </ComboboxTrigger>
          <div className="size-8 shrink-0">
            <ComboboxClear
              aria-label="Clear fallback app"
              className="size-8 rounded-lg hover:bg-state-base-hover"
            />
          </div>
        </div>
        <ComboboxPortal>
          <ComboboxPositioner>
            <ComboboxPopup aria-label="Fallback app">
              <ComboboxInputGroup>
                <span
                  aria-hidden="true"
                  className="i-ri-search-line size-4 shrink-0 text-components-input-text-placeholder"
                />
                <ComboboxInput aria-label="Search apps" placeholder="e.g. Invoice extractor" />
              </ComboboxInputGroup>
              <ComboboxEmpty>No app matches.</ComboboxEmpty>
              <ComboboxList<App>>
                {(app) => (
                  <ComboboxItem<string> key={app.id} value={app.id} disabled={!app.published}>
                    <ComboboxItemText>
                      {app.name}{' '}
                      <span className="ms-1 system-xs-regular text-text-tertiary">
                        {app.published ? app.mode : 'Not published'}
                      </span>
                    </ComboboxItemText>
                    <ComboboxItemIndicator />
                  </ComboboxItem>
                )}
              </ComboboxList>
            </ComboboxPopup>
          </ComboboxPositioner>
        </ComboboxPortal>
      </Combobox>
      <p aria-live="polite" className="system-xs-regular text-text-tertiary">
        Saved value:{' '}
        <code className="font-mono system-xs-medium text-text-secondary">{appId ?? 'null'}</code>
      </p>
    </div>
  )
}
```

## Keyboard

| Key                    | Action                                                                                     |
| ---------------------- | ------------------------------------------------------------------------------------------ |
| `ArrowDown`, `ArrowUp` | Opens the popup from the input and moves the highlight between items.                      |
| `Enter`, `ArrowDown`   | Opens the popup from a `ComboboxTrigger` and moves focus to its search input.              |
| `Enter`                | Selects the highlighted item. In single mode it fills the input and closes the popup.      |
| `Escape`               | Closes the popup and restores the input. With the popup closed, clears the selected value. |
| `ArrowLeft`            | Moves focus from the start of the input to the last chip, then to the previous chip.       |
| `ArrowRight`           | Moves focus to the next chip, then back to the input.                                      |
| `Backspace`, `Delete`  | Removes the focused chip. `Backspace` in an empty input removes the last chip.             |

## API reference

### Combobox

Groups all parts of a filterable combobox for selecting one or multiple predefined options. Doesn't render its own HTML element.

Supports inline input triggers, popup search inputs via `ComboboxTrigger`, and external surfaces via `inline`.

Inherits `children`, `name`, `form`, `id`, `required`, `readOnly`, `disabled`, `defaultOpen`, `open`, `onOpenChangeComplete`, `openOnInputClick`, `loopFocus`, `inputValue`, `defaultInputValue`, `inputRef`, `grid`, `items`, `filteredItems`, `filter`, `virtualized`, `inline`, `modal`, `limit`, `locale`, `multiple`, `autoComplete`, `autoHighlight`, `highlightItemOnHover`, `itemToStringLabel`, `itemToStringValue`, `isItemEqualToValue`, `defaultValue`, `actionsRef`, `onOpenChange`, `onInputValueChange`, `onItemHighlighted`, `value`, `onValueChange` from [Base UI Combobox.Root](https://base-ui.com/react/components/combobox#root).

### ComboboxChip

An individual chip that represents a value in a multiselectable input. Renders a `<div>` element.

Inherits `className`, `render`, `style` from [Base UI Combobox.Chip](https://base-ui.com/react/components/combobox#chip).

**Data attributes**

| Attribute       | Description                                           |
| --------------- | ----------------------------------------------------- |
| `data-disabled` | Whether the component should ignore user interaction. |

### ComboboxChipRemove

A button to remove a chip. Renders a `<button>` element.

Inherits `className`, `render`, `style`, `nativeButton` from [Base UI Combobox.ChipRemove](https://base-ui.com/react/components/combobox#chipremove).

**Data attributes**

| Attribute       | Description                                           |
| --------------- | ----------------------------------------------------- |
| `data-disabled` | Whether the component should ignore user interaction. |

### ComboboxChips

A container for the chips in a multiselectable input. Renders a `<div>` element.

Inherits `className`, `render`, `style` from [Base UI Combobox.Chips](https://base-ui.com/react/components/combobox#chips).

### ComboboxClear

Clears the value when clicked. Renders a `<button>` element.

**Props**

| Prop    | Type                             | Default    | Description                                                            |
| ------- | -------------------------------- | ---------- | ---------------------------------------------------------------------- |
| `size?` | `'large' \| 'medium' \| 'small'` | `'medium'` | The size of the button. Match the size of the surrounding input group. |

Inherits `disabled`, `keepMounted`, `className`, `render`, `style`, `nativeButton` from [Base UI Combobox.Clear](https://base-ui.com/react/components/combobox#clear).

**Data attributes**

| Attribute             | Description                                   |
| --------------------- | --------------------------------------------- |
| `data-popup-open`     | Present when the corresponding popup is open. |
| `data-disabled`       | Present when the button is disabled.          |
| `data-visible`        | Present when the clear button is visible.     |
| `data-starting-style` | Present when the button begins animating in.  |
| `data-ending-style`   | Present when the button is animating out.     |

### ComboboxCollection

Renders filtered list items. Doesn't render its own HTML element.

If rendering a flat list, pass a function child to the `List` component instead, which implicitly wraps it.

**Props**

| Prop       | Type                                             | Default | Description                                         |
| ---------- | ------------------------------------------------ | ------- | --------------------------------------------------- |
| `children` | `(item: Item, index: number) => React.ReactNode` | —       | Renders each item of the surrounding group or list. |

### ComboboxEmpty

Renders its children only when the list is empty. Requires the `items` prop on the root component. Announces changes politely to screen readers. This component's root element must remain mounted in the DOM to announce changes consistently across screen readers. Avoid hiding or removing the component itself with `display: none`, `hidden`, `aria-hidden`, or conditional rendering. Prefer updating or conditionally rendering its children instead. Renders a `<div>` element.

Inherits `className`, `render`, `style` from [Base UI Combobox.Empty](https://base-ui.com/react/components/combobox#empty).

### ComboboxGroup

Groups related items with the corresponding label. Renders a `<div>` element.

**Props**

| Prop     | Type              | Default | Description                                                                                  |
| -------- | ----------------- | ------- | -------------------------------------------------------------------------------------------- |
| `items?` | `readonly Item[]` | —       | The items rendered within this group. Child `ComboboxCollection` components use these items. |

Inherits `className`, `render`, `style` from [Base UI Combobox.Group](https://base-ui.com/react/components/combobox#group).

### ComboboxGroupLabel

An accessible label that is automatically associated with its parent group. Renders a `<div>` element.

Inherits `className`, `render`, `style` from [Base UI Combobox.GroupLabel](https://base-ui.com/react/components/combobox#grouplabel).

### ComboboxIcon

An icon that indicates that the trigger button opens the popup. Renders a `<span>` element.

Inherits `className`, `render`, `style` from [Base UI Combobox.Icon](https://base-ui.com/react/components/combobox#icon).

### ComboboxInput

A text input to search for items in the list. Renders an `<input>` element.

**Props**

| Prop    | Type                             | Default    | Description                                                                                      |
| ------- | -------------------------------- | ---------- | ------------------------------------------------------------------------------------------------ |
| `size?` | `'large' \| 'medium' \| 'small'` | `'medium'` | The vertical padding and type scale of the input. Match the size of the surrounding input group. |

Inherits `className`, `render`, `style`, `disabled` from [Base UI Combobox.Input](https://base-ui.com/react/components/combobox#input).

**Data attributes**

| Attribute         | Description                                                                        |
| ----------------- | ---------------------------------------------------------------------------------- |
| `data-popup-open` | Present when the corresponding popup is open.                                      |
| `data-pressed`    | Present when the input is pressed.                                                 |
| `data-disabled`   | Present when the component is disabled.                                            |
| `data-readonly`   | Present when the component is readonly.                                            |
| `data-popup-side` | Indicates which side the corresponding popup is positioned relative to its anchor. |
| `data-required`   | Present when the component is required.                                            |
| `data-valid`      | Present when the component is in a valid state (when wrapped in Field.Root).       |
| `data-invalid`    | Present when the component is in an invalid state (when wrapped in Field.Root).    |
| `data-touched`    | Present when the component has been touched (when wrapped in Field.Root).          |
| `data-dirty`      | Present when the component's value has changed (when wrapped in Field.Root).       |
| `data-filled`     | Present when the component has a value (when wrapped in Field.Root).               |
| `data-focused`    | Present when the input is focused (when wrapped in Field.Root).                    |
| `data-list-empty` | Present when the corresponding items list is empty.                                |

### ComboboxInputGroup

A wrapper for the input and its associated controls. Renders a `<div>` element.

**Props**

| Prop    | Type                             | Default    | Description                                                                                                  |
| ------- | -------------------------------- | ---------- | ------------------------------------------------------------------------------------------------------------ |
| `size?` | `'large' \| 'medium' \| 'small'` | `'medium'` | The height, padding, and corner radius of the group. Pass the same size to the input and controls inside it. |

Inherits `className`, `render`, `style` from [Base UI Combobox.InputGroup](https://base-ui.com/react/components/combobox#inputgroup).

**Data attributes**

| Attribute          | Description                                                                        |
| ------------------ | ---------------------------------------------------------------------------------- |
| `data-popup-open`  | Present when the corresponding popup is open.                                      |
| `data-pressed`     | Present when the input group is pressed.                                           |
| `data-disabled`    | Present when the component is disabled.                                            |
| `data-readonly`    | Present when the component is readonly.                                            |
| `data-popup-side`  | Indicates which side the corresponding popup is positioned relative to its anchor. |
| `data-valid`       | Present when the component is in a valid state (when wrapped in Field.Root).       |
| `data-invalid`     | Present when the component is in an invalid state (when wrapped in Field.Root).    |
| `data-touched`     | Present when the component has been touched (when wrapped in Field.Root).          |
| `data-dirty`       | Present when the component's value has changed (when wrapped in Field.Root).       |
| `data-filled`      | Present when the component has a value (when wrapped in Field.Root).               |
| `data-focused`     | Present when the component is focused (when wrapped in Field.Root).                |
| `data-list-empty`  | Present when the corresponding items list is empty.                                |
| `data-placeholder` | Present when the combobox doesn't have a value.                                    |

### ComboboxInputTrigger

A button that opens the popup. Renders a `<button>` element.

**Props**

| Prop    | Type                             | Default    | Description                                                            |
| ------- | -------------------------------- | ---------- | ---------------------------------------------------------------------- |
| `size?` | `'large' \| 'medium' \| 'small'` | `'medium'` | The size of the button. Match the size of the surrounding input group. |

Inherits `disabled`, `className`, `render`, `style`, `nativeButton` from [Base UI Combobox.Trigger](https://base-ui.com/react/components/combobox#trigger).

**Data attributes**

| Attribute          | Description                                                                        |
| ------------------ | ---------------------------------------------------------------------------------- |
| `data-popup-open`  | Present when the corresponding popup is open.                                      |
| `data-pressed`     | Present when the trigger is pressed.                                               |
| `data-disabled`    | Present when the component is disabled.                                            |
| `data-readonly`    | Present when the component is readonly.                                            |
| `data-popup-side`  | Indicates which side the corresponding popup is positioned relative to its anchor. |
| `data-required`    | Present when the component is required.                                            |
| `data-valid`       | Present when the component is in a valid state (when wrapped in Field.Root).       |
| `data-invalid`     | Present when the component is in an invalid state (when wrapped in Field.Root).    |
| `data-touched`     | Present when the component has been touched (when wrapped in Field.Root).          |
| `data-dirty`       | Present when the component's value has changed (when wrapped in Field.Root).       |
| `data-filled`      | Present when the component has a value (when wrapped in Field.Root).               |
| `data-focused`     | Present when the trigger is focused (when wrapped in Field.Root).                  |
| `data-list-empty`  | Present when the corresponding items list is empty.                                |
| `data-placeholder` | Present when the combobox doesn't have a value.                                    |

### ComboboxItem

An individual item in the list. Renders a `<div>` element.

**Props**

| Prop     | Type    | Default | Description                               |
| -------- | ------- | ------- | ----------------------------------------- |
| `value?` | `Value` | —       | A unique value that identifies this item. |

Inherits `className`, `render`, `style`, `nativeButton`, `children`, `index`, `disabled` from [Base UI Combobox.Item](https://base-ui.com/react/components/combobox#item).

**Data attributes**

| Attribute          | Description                           |
| ------------------ | ------------------------------------- |
| `data-selected`    | Present when the item is selected.    |
| `data-highlighted` | Present when the item is highlighted. |
| `data-disabled`    | Present when the item is disabled.    |

### ComboboxItemIndicator

Indicates whether the item is selected. Renders a `<span>` element.

**Props**

| Prop        | Type              | Default | Description                                               |
| ----------- | ----------------- | ------- | --------------------------------------------------------- |
| `children?` | `React.ReactNode` | —       | The indicator content. Renders a check icon when omitted. |

Inherits `className`, `render`, `style`, `keepMounted` from [Base UI Combobox.ItemIndicator](https://base-ui.com/react/components/combobox#itemindicator).

**Data attributes**

| Attribute             | Description                                     |
| --------------------- | ----------------------------------------------- |
| `data-starting-style` | Present when the indicator begins animating in. |
| `data-ending-style`   | Present when the indicator is animating out.    |

### ComboboxItemText

Accepts the props of the element it renders.

### ComboboxLabel

An accessible label that is automatically associated with the combobox trigger. Renders a `<div>` element.

Inherits `className`, `render`, `style` from [Base UI Combobox.Label](https://base-ui.com/react/components/combobox#label).

**Data attributes**

| Attribute       | Description                                                      |
| --------------- | ---------------------------------------------------------------- |
| `data-disabled` | Present when the component should ignore user interaction.       |
| `data-touched`  | Present when the field has been touched.                         |
| `data-dirty`    | Present when the field value has changed from its initial value. |
| `data-filled`   | Present when the field has a value.                              |
| `data-focused`  | Present when the field is focused.                               |

### ComboboxList

A list container for the items. Renders a `<div>` element.

**Props**

| Prop        | Type                                                                  | Default | Description                                             |
| ----------- | --------------------------------------------------------------------- | ------- | ------------------------------------------------------- |
| `children?` | `((item: Item, index: number) => React.ReactNode) \| React.ReactNode` | —       | The list content, or a function that renders each item. |

Inherits `className`, `render`, `style` from [Base UI Combobox.List](https://base-ui.com/react/components/combobox#list).

**Data attributes**

| Attribute    | Description                |
| ------------ | -------------------------- |
| `data-empty` | Whether the list is empty. |

### ComboboxPopup

A container for the list. Renders a `<div>` element.

Inherits `className`, `render`, `style`, `initialFocus`, `finalFocus` from [Base UI Combobox.Popup](https://base-ui.com/react/components/combobox#popup).

**Data attributes**

| Attribute             | Description                                                           |
| --------------------- | --------------------------------------------------------------------- |
| `data-open`           | Present when the popup is open.                                       |
| `data-closed`         | Present when the popup is closed.                                     |
| `data-starting-style` | Present when the popup begins animating in.                           |
| `data-ending-style`   | Present when the popup is animating out.                              |
| `data-side`           | Indicates which side the popup is positioned relative to the trigger. |
| `data-align`          | Indicates how the popup is aligned relative to specified side.        |
| `data-anchor-hidden`  | Present when the anchor is hidden.                                    |
| `data-empty`          | Present when the items list is empty.                                 |

### ComboboxPortal

A portal element that moves the popup to a different part of the DOM. By default, the portal element is appended to `<body>`. Renders a `<div>` element.

Inherits `keepMounted`, `container`, `className`, `render`, `style` from [Base UI Combobox.Portal](https://base-ui.com/react/components/combobox#portal).

### ComboboxPositioner

Positions the popup against the trigger. Renders a `<div>` element.

**Props**

| Prop          | Type                           | Default   | Description                                                                                             |
| ------------- | ------------------------------ | --------- | ------------------------------------------------------------------------------------------------------- |
| `align?`      | `'center' \| 'end' \| 'start'` | `'start'` | How to align the popup relative to the specified side.                                                  |
| `sideOffset?` | `number \| OffsetFunction`     | `4`       | Distance between the anchor and the popup in pixels. Also accepts a function that returns the distance. |

Inherits `className`, `render`, `style`, `anchor`, `positionMethod`, `side`, `alignOffset`, `collisionBoundary`, `collisionPadding`, `sticky`, `arrowPadding`, `disableAnchorTracking`, `collisionAvoidance` from [Base UI Combobox.Positioner](https://base-ui.com/react/components/combobox#positioner).

**Data attributes**

| Attribute            | Description                                                           |
| -------------------- | --------------------------------------------------------------------- |
| `data-open`          | Present when the popup is open.                                       |
| `data-closed`        | Present when the popup is closed.                                     |
| `data-anchor-hidden` | Present when the anchor is hidden.                                    |
| `data-side`          | Indicates which side the popup is positioned relative to the trigger. |
| `data-align`         | Indicates how the popup is aligned relative to specified side.        |
| `data-empty`         | Present when the items list is empty.                                 |

**CSS variables**

| Variable             | Type     | Description                                                                            |
| -------------------- | -------- | -------------------------------------------------------------------------------------- |
| `--available-width`  | `number` | The available width between the trigger and the edge of the viewport.                  |
| `--available-height` | `number` | The available height between the trigger and the edge of the viewport.                 |
| `--anchor-width`     | `number` | The anchor's width.                                                                    |
| `--anchor-height`    | `number` | The anchor's height.                                                                   |
| `--transform-origin` | `string` | The coordinates that this element is anchored to. Used for animations and transitions. |

### ComboboxRow

Displays a single row of items in a grid list. Enable `grid` on the root component to turn the listbox into a grid. Renders a `<div>` element.

Inherits `className`, `render`, `style` from [Base UI Combobox.Row](https://base-ui.com/react/components/combobox#row).

### ComboboxSeparator

A visual separator between items or groups. Renders a `<div>` element.

Inherits `orientation`, `className`, `render`, `style` from [Base UI Combobox.Separator](https://base-ui.com/react/components/combobox#separator).

**Data attributes**

| Attribute          | Description                       |
| ------------------ | --------------------------------- |
| `data-orientation` | The orientation of the separator. |

### ComboboxStatus

Displays a status message whose content changes are announced politely to screen readers. Useful for conveying the status of an asynchronously loaded list. This component's root element must remain mounted in the DOM to announce changes consistently across screen readers. Avoid hiding or removing the component itself with `display: none`, `hidden`, `aria-hidden`, or conditional rendering. Prefer updating or conditionally rendering its children instead. Renders a `<div>` element.

Inherits `className`, `render`, `style` from [Base UI Combobox.Status](https://base-ui.com/react/components/combobox#status).

### ComboboxTrigger

Opens the combobox popup; carries only focus-ring styles so callers own its appearance directly or via `render`. Renders a `<button>` element.

Inherits `disabled`, `className`, `render`, `style`, `nativeButton` from [Base UI Combobox.Trigger](https://base-ui.com/react/components/combobox#trigger).

**Data attributes**

| Attribute          | Description                                                                        |
| ------------------ | ---------------------------------------------------------------------------------- |
| `data-popup-open`  | Present when the corresponding popup is open.                                      |
| `data-pressed`     | Present when the trigger is pressed.                                               |
| `data-disabled`    | Present when the component is disabled.                                            |
| `data-readonly`    | Present when the component is readonly.                                            |
| `data-popup-side`  | Indicates which side the corresponding popup is positioned relative to its anchor. |
| `data-required`    | Present when the component is required.                                            |
| `data-valid`       | Present when the component is in a valid state (when wrapped in Field.Root).       |
| `data-invalid`     | Present when the component is in an invalid state (when wrapped in Field.Root).    |
| `data-touched`     | Present when the component has been touched (when wrapped in Field.Root).          |
| `data-dirty`       | Present when the component's value has changed (when wrapped in Field.Root).       |
| `data-filled`      | Present when the component has a value (when wrapped in Field.Root).               |
| `data-focused`     | Present when the trigger is focused (when wrapped in Field.Root).                  |
| `data-list-empty`  | Present when the corresponding items list is empty.                                |
| `data-placeholder` | Present when the combobox doesn't have a value.                                    |

### ComboboxValue

The current value of the combobox. Doesn't render its own HTML element.

**Props**

| Prop        | Type                                                                                              | Default | Description                                                                                                                                   |
| ----------- | ------------------------------------------------------------------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| `children?` | `((selectedValue: ComboboxSelectedValue<Value, Multiple>) => React.ReactNode) \| React.ReactNode` | —       | The content to show, or a function that formats the selected value. In `multiple` mode the function receives the selected values as an array. |

Inherits `placeholder` from [Base UI Combobox.Value](https://base-ui.com/react/components/combobox#value).

### createComboboxItems

Creates a collection for the root's `items` prop. Values and labels are derived on first use.

Accepts either a flat item array or an array of groups. The `getValue` and `getLabel` accessors receive items, not groups.

Items cannot have an `items` array property because they would be interpreted as groups. Rename that field or cast the data when the runtime values are known not to contain arrays.

The data must not contain nullish entries: remove them before creating the collection, as for the root's `items` prop.

Create static collections at module scope. Wrap dynamic collections in `React.useMemo()` keyed by their data.

```ts
createComboboxItems<Item, Value extends ComboboxPrimitiveValue>(
  data: (ComboboxItemsData<Item> & RejectGroupShapedItems<Item>) | undefined,
  options: CreateComboboxItemsOptions<Item, Value>,
): ComboboxItemCollection<Item, Value>
```

**Parameters**

| Parameter | Type                                                                    | Description                                                                 |
| --------- | ----------------------------------------------------------------------- | --------------------------------------------------------------------------- |
| `data`    | `(ComboboxItemsData<Item> & RejectGroupShapedItems<Item>) \| undefined` | The flat or grouped source items, or `undefined` while they are loading.    |
| `options` | `CreateComboboxItemsOptions<Item, Value>`                               | Functions that derive each source item's selection value and display label. |

**Returns:** `ComboboxItemCollection<Item, Value>`

A collection whose selection value is the `getValue` accessor's return value.

### useComboboxFilter

Matches items against a query using `Intl.Collator` for robust string matching.

```ts
useComboboxFilter(options?: UseComboboxFilterOptions): Filter
```

**Parameters**

| Parameter  | Type                       | Description |
| ---------- | -------------------------- | ----------- |
| `options?` | `UseComboboxFilterOptions` | —           |

**Returns:** `Filter`

**Return properties**

| Member       | Type                                                                                  | Description                                          |
| ------------ | ------------------------------------------------------------------------------------- | ---------------------------------------------------- |
| `contains`   | `<Item>(item: Item, query: string, itemToString?: (item: Item) => string) => boolean` | Returns whether the item matches the query anywhere. |
| `startsWith` | `<Item>(item: Item, query: string, itemToString?: (item: Item) => string) => boolean` | Returns whether the item starts with the query.      |
| `endsWith`   | `<Item>(item: Item, query: string, itemToString?: (item: Item) => string) => boolean` | Returns whether the item ends with the query.        |

### useComboboxFilteredItems

Returns the internally filtered items. Treat the result as read-only: it is internal state and may be a shared frozen array.

```ts
useComboboxFilteredItems<T>(): T[]
```

**Returns:** `T[]`
