Country 

The Country type provides a country selection.

Settings 

Name Type Default Required
string ''
boolean false
array []
string name
array []
array []

default

default
Type
string
Default
''

Default value set if a new record is created.

required

required
Type
boolean
Default
false

If true, an empty selection cannot be made.

filter

filter
Type
array
Default
[]

With the filter option it is possible to constrain the possible countries.

name: example/country
fields:
  - identifier: country
    type: Country
    filter:
      onlyCountries:
        - DE
        - AT
        - CH
Copied!
name: example/country
fields:
  - identifier: country
    type: Country
    filter:
      excludeCountries:
        - DE
        - AT
        - CH
Copied!

labelField

labelField
Type
string
Default
name

The value to use for the label. Possible values are:

  • localizedName
  • name
  • iso2
  • iso3
  • officialName
  • localizedOfficialName

prioritizedCountries

prioritizedCountries
Type
array
Default
[]

Countries (ISO2 or ISO3 codes) which are listed before all others countries.

name: example/country
fields:
  - identifier: country
    type: Country
    prioritizedCountries:
      - DE
      - AT
      - CH
Copied!

sortItems

sortItems
Type
array
Default
[]

Sort order of the select items in the country picker.

name: example/country
fields:
  - identifier: country
    type: Country
    sortItems:
      label: 'desc'
Copied!

Example 

Minimal 

name: example/country
fields:
  - identifier: country
    type: Country
Copied!

Advanced / use case 

name: example/country
fields:
  - identifier: country
    type: Country
    required: true
    default: 'DE'
    labelField: 'localizedName'
    prioritizedCountries:
      - DE
      - AT
      - CH
Copied!