A searchable ISO 3166-1 based list of country names, codes and emoji flags.
The library is intended to be used qualified (i.e. Countries.search
, Countries.all
).
> import Countries
> Countries.fromCode "AU"
Just { name = "Australia", code = "AU", flag = "🇦🇺" }
: Maybe.Maybe Countries.Country
See the examples
folder for a basic country picker example.
{ name : String
, code : String
, flag : String
}
The Country record type.
This type is intentionally not opaque, as accessing the countries reference data as easily as possible is the primary goal.
fromCode : String -> Maybe Country
Find a country by its ISO 3166-1 alpha-2 two-letter country code.
search : String -> List Country
Search all Countries by case-insensitive string matching on name and code
all : List Country
The full list of all 249 current ISO 3166-1 Country records.