Skip to content
← Inventory

CountrySelect

Country selector with flag display. Controlled: value (ISO 3166-1 alpha-2) drives the selection and onChange reports the newly chosen code. A native <select> overlays the flag so the picker keeps native keyboard and mobile behavior.

🌐

Usage

import { CountrySelect, countrySelectVariants, flagVariants } from "@desk/ui/components/country-select";

Best practices

  • CountrySelect is the flag + native-<select> picker for a known country list; when users need type-to-filter, use CountryCombobox instead.

  • It is controlled-only — pass value (ISO 3166-1 alpha-2) and an onChange; there is no uncontrolled/defaultValue mode.

  • Give each option an alpha-2 value (e.g. "US") so the overlaid flag resolves; a globe placeholder shows when the code is empty/unknown.

Props

PropTypeDefaultDescription
aria-labelstring

Accessible label for the select

classNamestring

Additional class name

disabledboolean

Disabled state

onChange(required)(value: T) => void

Callback when country changes

options(required)CountryOption<T>[]

Available country options

sizeResponsiveSize | null

Component size — a single token or a per-breakpoint object like { base: "sm", md: "lg" }. null falls back to the default.

valueT

Currently selected country code

Also exports

  • constcountrySelectVariants
  • constflagVariants

Composition

Used by

PhoneInput