# Combobox preview

Interactive preview of the CyberSpec Combobox component. A text control that filters a list of options as you type.

[View Combobox preview on CyberSpec](https://www.cyberspec.dev/preview/combobox)

## About this preview

Combobox belongs to the Pickers group in the CyberSpec catalog. It uses @ui-sdk/react/combobox.

## Installation

Use a React 19 project with shadcn configured. Render the installed components inside the Cyber root, and import your global stylesheet in the app entry point.

```sh
bunx --bun shadcn@latest add https://www.cyberspec.dev/r/combobox.json
```

## Example

```tsx
"use client"

import { Combobox } from "@/components/ui/combobox"

export default function ComboboxDemo() {
  return (
    <>
      <Combobox
        label="Contact"
        placeholder="Search contacts"
        defaultValue="juno"
        empty="No contact by that name."
        hint="Type a name or a trade."
        options={[
          { value: "mara", label: "Mara Voss", meta: "Fixer" },
          { value: "ilya", label: "Ilya Brandt", meta: "Tech" },
          { value: "juno", label: "Juno Okafor", meta: "Medic" },
          { value: "dex", label: "Dex Marlowe", meta: "Driver" },
          { value: "sable", label: "Sable Quinn", meta: "Runner" },
          { value: "ren", label: "Ren Aoki", meta: "Broker", disabled: true },
        ]}
      />
    </>
  )
}
```

## Install this example

```sh
bunx --bun shadcn@latest add https://www.cyberspec.dev/r/combobox-demo.json
```

## Resources

- [Combobox documentation](https://www.cyberspec.dev/components/sidebar/combobox.md)
- [Component catalog](https://www.cyberspec.dev/components.md)
- [Combobox source code](https://github.com/agnelnieves/cyberspec/blob/main/registry/cyber/ui/combobox.tsx)
- [Shadcn registry item](https://www.cyberspec.dev/r/combobox.json)
