# Combobox

> An autocomplete input — a Popover wrapping a Command list (composed, not a single tag).

_Updated: 2026-06-04_

An autocomplete input — a Popover wrapping a Command list (composed, not a single tag).

## Installation

```bash
railbase ui add combobox
```

> [!NOTE]
> `railbase ui add` also copies the `command`, `popover` components — they ship alongside this component automatically.

## Usage

```tsx
import { Popover, PopoverTrigger, PopoverContent, Command, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem } from "@/lib/ui/combobox";

<Popover>
  <PopoverTrigger>Select framework…</PopoverTrigger>
  <PopoverContent>
    <Command>
      <CommandInput placeholder="Search…" />
      <CommandList>
        <CommandEmpty>No results.</CommandEmpty>
        <CommandGroup>
          <CommandItem value="next">Next.js</CommandItem>
          <CommandItem value="astro">Astro</CommandItem>
        </CommandGroup>
      </CommandList>
    </Command>
  </PopoverContent>
</Popover>
```

## Anatomy

Exported parts: `Popover` · `PopoverTrigger` · `PopoverContent` · `Command` · `CommandInput` · `CommandList` · `CommandEmpty` · `CommandGroup` · `CommandItem` · `CommandSeparator`
