

<InteractiveDemo
  name="combobox"
  controls="[
  {
    type: 'string',
    name: 'label',
    defaultValue: 'Country',
  },
  {
    type: 'string',
    name: 'placeholder',
    defaultValue: 'Search countries...',
  },
  {
    type: 'boolean',
    name: 'isDisabled',
    defaultValue: false,
  },
  {
    type: 'boolean',
    name: 'isInvalid',
    defaultValue: false,
  },
]"
/>

## Installation [#installation]

<CodeBlockTabs defaultValue="npm">
  <CodeBlockTabsList>
    <CodeBlockTabsTrigger value="npm">
      npm
    </CodeBlockTabsTrigger>

    <CodeBlockTabsTrigger value="pnpm">
      pnpm
    </CodeBlockTabsTrigger>

    <CodeBlockTabsTrigger value="yarn">
      yarn
    </CodeBlockTabsTrigger>

    <CodeBlockTabsTrigger value="bun">
      bun
    </CodeBlockTabsTrigger>
  </CodeBlockTabsList>

  <CodeBlockTab value="npm">
    ```bash
    npx shadcn@latest add @dotui/combobox
    ```
  </CodeBlockTab>

  <CodeBlockTab value="pnpm">
    ```bash
    pnpm dlx shadcn@latest add @dotui/combobox
    ```
  </CodeBlockTab>

  <CodeBlockTab value="yarn">
    ```bash
    yarn dlx shadcn@latest add @dotui/combobox
    ```
  </CodeBlockTab>

  <CodeBlockTab value="bun">
    ```bash
    bun x shadcn@latest add @dotui/combobox
    ```
  </CodeBlockTab>
</CodeBlockTabs>

## Usage [#usage]

Use `Combobox` to allow users to filter a list of options to items matching a query and select an item from the list.

```tsx
import {
  Combobox,
  ComboboxContent,
  ComboboxInput,
  ComboboxItem,
} from '@/components/ui/combobox'
```

```tsx
<Combobox>
  <ComboboxInput />
  <ComboboxContent>
    <ComboboxItem>Option 1</ComboboxItem>
    <ComboboxItem>Option 2</ComboboxItem>
  </ComboboxContent>
</Combobox>
```

## Examples [#examples]

<Examples>
  <Example name="combobox/demos/basic" />

  <Example name="combobox/demos/label" />

  <Example name="combobox/demos/description" />

  <Example name="combobox/demos/invalid" />

  <Example name="combobox/demos/custom-value" />

  <Example name="combobox/demos/disabled" />

  <Example name="combobox/demos/loading" />

  <Example name="combobox/demos/sections" />

  <Example name="combobox/demos/required" />

  <Example name="combobox/demos/uncontrolled" />

  <Example name="combobox/demos/controlled" />

  <Example name="combobox/demos/async-loading" />
</Examples>

## API Reference [#api-reference]

### Combobox [#combobox]

<Reference name="combobox" />

### ComboboxValue [#comboboxvalue]

<Reference name="combobox-value" />
