Skip to main content
Version: v0.23.2

Migrate from react-native-country-picker-modal

CountryPicker is a form field like the others: it shows the chosen country and opens a searchable list, a bottom sheet on phones and a dropdown on the web. Flags are emoji, so nothing is downloaded, and names follow the device language through Intl. The value is the ISO code; getCountry gives the name, flag and dialing code.

- import CountryPicker from 'react-native-country-picker-modal';
+ import { CountryPicker } from '@elik56a/react-native-pickers';

- <CountryPicker
- countryCode={code}
- withFilter
- withCallingCode
- onSelect={(country) => setCode(country.cca2)}
- />
+ <CountryPicker label="Country" showDialCode value={code} onChange={setCode} />
react-native-country-picker-modalReact Native Pickers
countryCodevalue
onSelect(country)onChange(code, option); getCountry(code) for the details
countryCodescountries
excludeCountriesexclude
preferredCountriespreferred (kept on top under their own header, with search too)
region / subregioncountries with that region's codes
withFiltersearch is built in
withCallingCodeshowDialCode
withFlag / withEmojialways on: emoji flags, nothing to download
translationlocale, any language Intl knows
withAlphaFiltersearch instead; it also matches native names, ISO codes and +44
placeholderplaceholder
visible / onOpen / onCloseonOpen / onClose; renderTrigger for your own button
withCallingCodeButton for a phone inputPhoneField
withCurrency / withCurrencyButtonno equivalent
—multiple, clearable, iOS, Material and web designs

See all migration guides for other libraries, and Comparison for when another library is the better choice.