# Shadcn Country Picker

> A combobox rendered inside a popup

- Type: example, free and open source (MIT)
- Component: [Combobox](https://reui.io/components/combobox.md)
- Page: https://reui.io/components/combobox/c-combobox-10
- Docs (Base UI): https://ui.shadcn.com/docs/components/base/combobox.md
- Docs (Radix UI): https://ui.shadcn.com/docs/components/radix/combobox.md
- MCP: `get_example("c-combobox-10")`
- Registry item: https://reui.io/r/styles/base-nova/c-combobox-10.json
- Uses: Button, Combobox, Field

## Best for

A country picker whose outline button shows the chosen flag and name, with the search box moved inside the popup

## Agent notes

- Flags load from `flagcdn.com` by each country `code`; self host them or swap the source before shipping

## Install

```bash
npx shadcn@latest add @reui/c-combobox-10
```

## About Shadcn Combobox

### When to use

- Form fields that pick one option by typing to search, such as a framework, timezone or country
- Fields holding several picks as chips, such as frameworks or team members with avatars
- Task property pickers opened from a button, such as status, priority, assignee, labels, team or due date

### When not to use

- A short fixed list chosen from a button, with no typing to narrow it: use [Select](https://reui.io/components/select.md) (`get_component("select")`)
- A free text field that suggests matches but keeps whatever was typed: use [Autocomplete](https://reui.io/components/autocomplete.md) (`get_component("autocomplete")`)
- A complete signup or settings page with many fields and a submit row: use the [Form blocks](https://reui.io/blocks/application/form.md)

### Agent notes

- Rows filter as the user types only when the function child of `ComboboxList` renders them; static `ComboboxItem` children always stay listed
- `itemToStringValue` sets only the submitted value; without itemToStringLabel, search matches an object item's label, else its value field, else its JSON
- Combobox parts take `render` in both twins, since both wrap `@base-ui/react`; `asChild` applies only to radix twin parts such as `DialogTrigger` and `Button`

Every ReUI item has a twin like this one; the index is https://reui.io/llms.txt. Agents with the ReUI MCP (https://reui.io/docs/mcp) get the same guidance from the getters named above.
