# V select 9

> Basic select

A shadcn/ui block from the [@cnippet](https://ui.cnippet.dev/) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/cnippet/v-select-9).

- Page, with a live preview: https://shadcn.exchange/r/cnippet/v-select-9
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/cnippet/v-select-9-light-1a51bd2d00e6e7ee.png
- Registry item: https://ui.cnippet.dev/r/v-select-9.json
- Categories: select
- Listed: 2026-10-13, source last changed 2026-10-13

## Install

```bash
npx shadcn@latest add https://ui.cnippet.dev/r/v-select-9.json
```

Run it in a project that has shadcn/ui set up. It adds the files below and installs what they depend on.

## Dependencies

- Registry items: `@cnippet/select`

## Files

### `registry/default/variants/v-select-9.tsx`

```tsx
import {
  Select,
  SelectGroup,
  SelectGroupLabel,
  SelectItem,
  SelectPopup,
  SelectTrigger,
  SelectValue,
} from "@/registry/default/ui/select";

const countryGroups = [
  {
    items: [
      { label: "🇺🇸 United States", value: "us" },
      { label: "🇨🇦 Canada", value: "ca" },
      { label: "🇲🇽 Mexico", value: "mx" },
    ],
    label: "North America",
  },
  {
    items: [
      { label: "🇬🇧 United Kingdom", value: "gb" },
      { label: "🇩🇪 Germany", value: "de" },
      { label: "🇫🇷 France", value: "fr" },
      { label: "🇮🇹 Italy", value: "it" },
      { label: "🇪🇸 Spain", value: "es" },
      { label: "🇳🇱 Netherlands", value: "nl" },
    ],
    label: "Europe",
  },
  {
    items: [
      { label: "🇯🇵 Japan", value: "jp" },
      { label: "🇨🇳 China", value: "cn" },
      { label: "🇮🇳 India", value: "in" },
      { label: "🇦🇺 Australia", value: "au" },
      { label: "🇸🇬 Singapore", value: "sg" },
      { label: "🇰🇷 South Korea", value: "kr" },
    ],
    label: "Asia Pacific",
  },
  {
    items: [
      { label: "🇧🇷 Brazil", value: "br" },
      { label: "🇦🇷 Argentina", value: "ar" },
      { label: "🇨🇴 Colombia", value: "co" },
    ],
    label: "Latin America",
  },
];

const placeholder = { label: "Select a country", value: null };
const allItems = [placeholder, ...countryGroups.flatMap((g) => g.items)];

export default function Component() {
  return (
    <Select items={allItems}>
      <SelectTrigger className="w-56">
        <SelectValue />
      </SelectTrigger>
      <SelectPopup className="max-h-64">
        {countryGroups.map((group) => (
          <SelectGroup key={group.label}>
            <SelectGroupLabel>{group.label}</SelectGroupLabel>
            {group.items.map((item) => (
              <SelectItem key={item.value} value={item}>
                {item.label}
              </SelectItem>
            ))}
          </SelectGroup>
        ))}
      </SelectPopup>
    </Select>
  );
}
```
