# Combobox

- **Section:** Components
- **URL:** https://refast.fastapicloud.dev/docs/components/combobox
- **Markdown:** https://refast.fastapicloud.dev/docs/components/combobox.md
- **Source:** https://github.com/idling-mind/refast-docs/blob/main/docs/pages/components/form_inputs/combobox.py
- **Live examples:** the widgets on this page need a browser; open the URL above to try them.
- **Applies to:** refast 0.12.2

A searchable dropdown with type-ahead filtering and optional multi-select.
Options are dicts with required `value` and `label` keys.

```python
from refast.components.shadcn.controls import Combobox

Combobox(
    label="Framework",
    options=[
        {"value": "next", "label": "Next.js"},
        {"value": "react", "label": "React"},
        {"value": "vue", "label": "Vue"},
    ],
    placeholder="Select framework…",
    on_select=ctx.callback(handle_select),
)
```

```python
Combobox(
    label="Framework",
    options=[
        {"value": "next", "label": "Next.js", "description": "The React Framework"},
        ...
    ],
    placeholder="Select framework…",
    multiselect=False,
    disabled=False,
    required=False,
    on_select=ctx.callback(handle_select),
)
```

## Props

| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `options` | `list[dict]` | `[]` | Options with required `value` and `label` keys |
| `value` | `str \| list[str] \| None` | `None` | Controlled selected value(s) |
| `placeholder` | `str` | `"Select..."` | Trigger text when nothing is selected |
| `search_placeholder` | `str` | `"Search..."` | Placeholder in the search input |
| `empty_text` | `str` | `"No results found."` | Text when no options match |
| `multiselect` | `bool` | `False` | Allow selecting multiple values |
| `disabled` | `bool` | `False` | Disables interaction |
| `label` | `str \| None` | `None` | Label text |
| `description` | `str \| None` | `None` | Help text below label |
| `required` | `bool` | `False` | Shows required asterisk |
| `error` | `str \| None` | `None` | Error message |
| `on_select` | `Callback \| None` | `None` | Fired when selection changes |

## Rich Options

Options can include optional metadata for richer display:

```python
options=[
    {
        "value": "python",
        "label": "Python",
        "description": "A versatile language",
        "icon": "Code",
    },
]
```

---

Part of the Refast documentation: [all pages](https://refast.fastapicloud.dev/llms.txt), [everything on one page](https://refast.fastapicloud.dev/llms-full.txt), [search](https://refast.fastapicloud.dev/api/search?q=save_prop).
