Loading...

Building Better Country Selects

A critique of the standard country dropdown and a better alternative.
Darren Rush

Country selection appears in nearly every checkout, registration, and shipping form on the web. Most implementations still rely on a native HTML select populated with all 195 countries in alphabetical order. That is a defensible default, but not a very good one. It is slow to scan, hard to search, and especially awkward on mobile.

This post examines where the standard pattern breaks down and outlines a better alternative.

The Problem with Standard Country Dropdowns

A full country list inside a native select has several structural limitations:

  • No filtering. Users cannot narrow the list by typing. With 195 options, that usually means scrolling. On mobile, it often means working through a system picker whose behavior and appearance vary by platform.

  • Alphabetical order ignores actual usage. Most products serve users from a relatively small set of countries. Alphabetical sorting treats Andorra and Australia as equally likely choices. Common selections such as the United States, United Kingdom, India, Canada, and Australia are scattered throughout the list.

  • Country naming often does not match user expectations. Users look for familiar names and abbreviations: "US," "UK," "UAE," "South Korea." Many lists use formal names instead, such as "United States of America" or "Korea, Republic of," which slows recognition and search.

  • Plain text lists are hard to scan. A long list of similar-looking labels offers very little visual structure or recognition support.

Native selects work well for short, stable lists. A complete country list is neither short nor especially easy to navigate.

A Traditional Country Select

checkout.example.com/shipping

Shipping Address

!
Sarah is in the United Kingdom. To select it, she has to scroll well into the lower half of the list, or rely on browser behavior that varies by device. There is no autocomplete, no location hint, and no fast path for a very common selection.

Fig. 1 - Standard country dropdown. Long list, alphabetical order, no filtering.

The Modal Country Select

There are several simple improvements we can make to a the simple <select>:

  • Use a modal, rather than a simple menu, to allow for better results display, filtering, and context.

  • Use a smarter heuristic for sorting.

  • Improve the way results are displayed.

  • Match on codes, common names, and full names.

  • Use browser hints to guess the user’s country.

  • Use multiple columns for desktop users.

Improved Country Select

Interactive Improved Picker

This version uses a full country dataset, native dialog semantics, and smarter search matching on codes, aliases, and full names.

Search by country code, common name, or formal name. The dialog also surfaces a browser-locale suggestion without forcing a default choice.

Select country

Conclusions

Country selection is a small interaction that exposes a larger UI mistake: treating a search problem like a menu problem. For high-cardinality lists such as countries, the standard dropdown is easy to ship but unnecessarily slow to use. Modal selects offer a better UX, and with a little extra work, perform well on mobile too.

Get the Code

Talsyto / Better Country Select

Standalone component · Vanilla JS · No dependencies · MIT licence

View on GitHub ↗
Top