# Combobox

Search a bounded set of choices and select without leaving the keyboard.

- Family: Interaction, imported from `mizu-ui` or `mizu-ui/interaction`
- Docs: https://mizu.user64bit.world/components/combobox
- Source: https://github.com/0xuser64bit/mizu/blob/main/packages/mizu/src/interaction/Combobox.tsx

## Usage

```tsx
"use client";

import { useState } from "react";
import { Combobox } from "mizu-ui";

export function Example() {
  const [value, setValue] = useState("react");
  return (
    <Combobox
      label="Framework"
      value={value}
      onValueChange={setValue}
      options={[
        {
          value: "react",
          label: "React",
          description: "Compose with components",
        },
        {
          value: "next",
          label: "Next.js",
          description: "React with server rendering",
        },
        { value: "vite", label: "Vite", description: "A quick client build" },
      ]}
    />
  );
}
```

## Copy it with the shadcn CLI

```sh
npx shadcn@latest init 0xuser64bit/mizu/preset # once, where there is no components.json
npx shadcn@latest add 0xuser64bit/mizu/combobox
```

## Props

- `label / value / onValueChange`: `string / string / function`. Accessible name and controlled selected value.
- `options`: `Choice[]`. Value, label, description and disabled.
- `placeholder / disabled`: `string / boolean`. Prompt and availability.

## Accessibility

Combobox with listbox and active-descendant relationships. Type filters; arrows wrap, Enter selects, Escape dismisses without changing the value. Disabled choices are excluded.

## Motion

CSS transitions explain state changes. Reduced motion removes travel.
