CountrySelector

Domain

Country dropdown built from countries-list. Shows flag + full name + ISO2 code. Supports search by name or code, error/hint states.

Default

Preview
Code
<%- include('modules/domain/common/location/CountrySelector', {
  name: 'countryCode',
  value: 'TR',
  countries: countryList
}) %>

With hint & error

Preview

Used for shipping address.

Code
<%- include('modules/domain/common/location/CountrySelector', {
  name: 'countryCode',
  countries: countryList,
  hint: 'Used for shipping address.'
}) %>
<%- include('modules/domain/common/location/CountrySelector', {
  name: 'countryCode',
  countries: countryList,
  error: 'Please select a country.',
  required: true
}) %>

No label

Preview
Code
<%- include('modules/domain/common/location/CountrySelector', {
  name: 'countryCode',
  value: 'US',
  countries: countryList,
  label: ''
}) %>
Source modules/domain/common/location/CountrySelector.ejs