Description
Field.SelectCountry
is a wrapper component for the selection component, with options built in for selecting a country.
When selecting a country, the value returned is the selected country's ISO 3166-1 alpha-2 code like NO
for Norway.
import { Field } from '@dnb/eufemia/extensions/forms'render(<Field.SelectCountry />)
It supports the HTML autofill attribute (country-name
) if no value is given.
Filter or prioritize country listing
Countries are sorted in alphabetically order. You can filter countries with the countries
property or put these countries on top of the list:
- Norway
- Sweden
- Denmark
- Finland
import { Field } from '@dnb/eufemia/extensions/forms'render(<Field.PhoneNumber countries="Prioritized" />)