Phone Input

The Phone Input is used to collect phone numbers with international dial codes. It contains a dropdown which allows the user to choose from a list of countries and dial codes.

Basic Usage

+1

Alternate Default Country

+40

Controlled

+81

Localized Country Names

+1

Supported Countries

The following countries are available in the country selector dropdown. You can import these as an object COUNTRIES from baseui/phone-input. Note, the country objects are formatted for ease of use with our Select component.

COUNTRIES: { id: string, // Country ISO label: string, // Country Name dialCode: string // Country Dial Code }
ID
Label
Dial Code
AF
Afghanistan (‫افغانستان‬‎)
+93
AL
Albania (Shqipëri)
+355
DZ
Algeria (‫الجزائر‬‎)
+213
AS
American Samoa
+1684
AD
Andorra
+376
AO
Angola
+244
AI
Anguilla
+1264
AG
Antigua and Barbuda
+1268
AR
Argentina
+54
AM
Armenia (Հայաստան)
+374
AW
Aruba
+297
AU
Australia
+61
AT
Austria (Österreich)
+43
AZ
Azerbaijan (Azərbaycan)
+994
BS
Bahamas
+1242
BH
Bahrain (‫البحرين‬‎)
+973
BD
Bangladesh (বাংলাদেশ)
+880
BB
Barbados
+1246
BY
Belarus (Беларусь)
+375
BE
Belgium (België)
+32
BZ
Belize
+501
BJ
Benin (Bénin)
+229
BM
Bermuda
+1441
BT
Bhutan (འབྲུག)
+975
BO
Bolivia
+591
BA
Bosnia and Herzegovina (Босна и Херцеговина)
+387
BW
Botswana
+267
BR
Brazil (Brasil)
+55
IO
British Indian Ocean Territory
+246
VG
British Virgin Islands
+1284
BN
Brunei
+673
BG
Bulgaria (България)
+359
BF
Burkina Faso
+226
BI
Burundi (Uburundi)
+257
KH
Cambodia (កម្ពុជា)
+855
CM
Cameroon (Cameroun)
+237
CA
Canada
+1
CV
Cape Verde (Kabu Verdi)
+238
KY
Cayman Islands
+1345
CF
Central African Republic (République centrafricaine)
+236
TD
Chad (Tchad)
+235
CL
Chile
+56
CN
China (中国)
+86
CX
Christmas Island
+61
CC
Cocos (Keeling) Islands
+61
CO
Colombia
+57
KM
Comoros (‫جزر القمر‬‎)
+269
CD
Congo (DRC) (Jamhuri ya Kisoemokrasia ya Kongo)
+243
CG
Congo (Republic) (Congo-Brazzaville)
+242
CK
Cook Islands
+682
CR
Costa Rica
+506
CI
Côte d’Ivoire
+225
HR
Croatia (Hrvatska)
+385
CU
Cuba
+53
CW
Curaçao
+599
CY
Cyprus (Κύπρος)
+357
CZ
Czech Republic (Česká republika)
+420
DK
Denmark (Danmark)
+45
DJ
Djibouti
+253
DM
Dominica
+1767
DO
Dominican Republic (República Dominicana)
+1
EC
Ecuador
+593
EG
Egypt (‫مصر‬‎)
+20
SV
El Salvador
+503
GQ
Equatorial Guinea (Guinea Ecuatorial)
+240
ER
Eritrea
+291
EE
Estonia (Eesti)
+372
ET
Ethiopia
+251
FK
Falkland Islands (Islas Malvinas)
+500
FO
Faroe Islands (Føroyar)
+298
FJ
Fiji
+679
FI
Finland (Suomi)
+358
FR
France
+33
GF
French Guiana (Guyane française)
+594
PF
French Polynesia (Polynésie française)
+689
GA
Gabon
+241
GM
Gambia
+220
GE
Georgia (საქართველო)
+995
DE
Germany (Deutschland)
+49
GH
Ghana (Gaana)
+233
GI
Gibraltar
+350
GR
Greece (Ελλάδα)
+30
GL
Greenland (Kalaallit Nunaat)
+299
GD
Grenada
+1473
GP
Guadeloupe
+590
GU
Guam
+1671
GT
Guatemala
+502
GG
Guernsey
+44
GN
Guinea (Guinée)
+224
GW
Guinea-Bissau (Guiné Bissau)
+245
GY
Guyana
+592
HT
Haiti
+509
HN
Honduras
+504
HK
Hong Kong (香港)
+852
HU
Hungary (Magyarország)
+36
IS
Iceland (Ísland)
+354
IN
India (भारत)
+91
ID
Indonesia
+62
IR
Iran (‫ایران‬‎)
+98
IQ
Iraq (‫العراق‬‎)
+964
IE
Ireland
+353
IM
Isle of Man
+44
IL
Israel (‫ישראל‬‎)
+972
IT
Italy (Italia)
+39
JM
Jamaica
+1
JP
Japan (日本)
+81
JE
Jersey
+44
JO
Jordan (‫الأردن‬‎)
+962
KZ
Kazakhstan (Казахстан)
+7
KE
Kenya
+254
KI
Kiribati
+686
XK
Kosovo
+383
KW
Kuwait (‫الكويت‬‎)
+965
KG
Kyrgyzstan (Кыргызстан)
+996
LA
Laos (ລາວ)
+856
LV
Latvia (Latvija)
+371
LB
Lebanon (‫لبنان‬‎)
+961
LS
Lesotho
+266
LR
Liberia
+231
LY
Libya (‫ليبيا‬‎)
+218
LI
Liechtenstein
+423
LT
Lithuania (Lietuva)
+370
LU
Luxembourg
+352
MO
Macau (澳門)
+853
MK
Macedonia (FYROM) (Македонија)
+389
MG
Madagascar (Madagasikara)
+261
MW
Malawi
+265
MY
Malaysia
+60
MV
Maldives
+960
ML
Mali
+223
MT
Malta
+356
MH
Marshall Islands
+692
MQ
Martinique
+596
MR
Mauritania (‫موريتانيا‬‎)
+222
MU
Mauritius (Moris)
+230
YT
Mayotte
+262
MX
Mexico (México)
+52
FM
Micronesia
+691
MD
Moldova (Republica Moldova)
+373
MC
Monaco
+377
MN
Mongolia (Монгол)
+976
ME
Montenegro (Crna Gora)
+382
MS
Montserrat
+1664
MA
Morocco (‫المغرب‬‎)
+212
MZ
Mozambique (Moçambique)
+258
MM
Myanmar (Burma) (မြန်မာ)
+95
NA
Namibia (Namibië)
+264
NR
Nauru
+674
NP
Nepal (नेपाल)
+977
NL
Netherlands (Nederland)
+31
NC
New Caledonia (Nouvelle-Calédonie)
+687
NZ
New Zealand
+64
NI
Nicaragua
+505
NE
Niger (Nijar)
+227
NG
Nigeria
+234
NU
Niue
+683
NF
Norfolk Island
+672
KP
North Korea (조선 민주주의 인민 공화국)
+850
MP
Northern Mariana Islands
+1670
NO
Norway (Norge)
+47
OM
Oman (‫عُمان‬‎)
+968
PK
Pakistan (‫پاکستان‬‎)
+92
PW
Palau
+680
PS
Palestine (‫فلسطين‬‎)
+970
PA
Panama (Panamá)
+507
PG
Papua New Guinea
+675
PY
Paraguay
+595
PE
Peru (Perú)
+51
PH
Philippines
+63
PL
Poland (Polska)
+48
PT
Portugal
+351
PR
Puerto Rico
+1
QA
Qatar (‫قطر‬‎)
+974
RE
Réunion (La Réunion)
+262
RO
Romania (România)
+40
RU
Russia (Россия)
+7
RW
Rwanda
+250
BL
Saint Barthélemy
+590
SH
Saint Helena
+290
KN
Saint Kitts and Nevis
+1869
LC
Saint Lucia
+1758
MF
Saint Martin (Saint-Martin (partie française))
+590
PM
Saint Pierre and Miquelon (Saint-Pierre-et-Miquelon)
+508
VC
Saint Vincent and the Grenadines
+1784
WS
Samoa
+685
SM
San Marino
+378
ST
São Tomé and Príncipe (São Tomé e Príncipe)
+239
SA
Saudi Arabia (‫المملكة العربية السعودية‬‎)
+966
SN
Senegal (Sénégal)
+221
RS
Serbia (Србија)
+381
SC
Seychelles
+248
SL
Sierra Leone
+232
SG
Singapore
+65
SX
Sint Maarten
+1721
SK
Slovakia (Slovensko)
+421
SI
Slovenia (Slovenija)
+386
SB
Solomon Islands
+677
SO
Somalia (Soomaaliya)
+252
ZA
South Africa
+27
KR
South Korea (대한민국)
+82
SS
South Sudan (‫جنوب السودان‬‎)
+211
ES
Spain (España)
+34
LK
Sri Lanka (ශ්‍රී ලංකාව)
+94
SD
Sudan (‫السودان‬‎)
+249
SR
Suriname
+597
SJ
Svalbard and Jan Mayen
+47
SZ
Swaziland
+268
SE
Sweden (Sverige)
+46
CH
Switzerland (Schweiz)
+41
SY
Syria (‫سوريا‬‎)
+963
TW
Taiwan (台灣)
+886
TJ
Tajikistan
+992
TZ
Tanzania
+255
TH
Thailand (ไทย)
+66
TL
Timor-Leste
+670
TG
Togo
+228
TK
Tokelau
+690
TO
Tonga
+676
TT
Trinisoad and Tobago
+1868
TN
Tunisia (‫تونس‬‎)
+216
TR
Turkey (Türkiye)
+90
TM
Turkmenistan
+993
TC
Turks and Caicos Islands
+1649
TV
Tuvalu
+688
VI
U.S. Virgin Islands
+1340
UG
Uganda
+256
UA
Ukraine (Україна)
+380
AE
United Arab Emirates (‫الإمارات العربية المتحدة‬‎)
+971
GB
United Kingdom
+44
US
United States
+1
UY
Uruguay
+598
UZ
Uzbekistan (Oʻzbekiston)
+998
VU
Vanuatu
+678
VA
Vatican City (Città del Vaticano)
+39
VE
Venezuela
+58
VN
Vietnam (Việt Nam)
+84
WF
Wallis and Futuna (Wallis-et-Futuna)
+681
YE
Yemen (‫اليمن‬‎)
+967
ZM
Zambia
+260
ZW
Zimbabwe
+263
AX
Åland Islands
+358

Overrides

Additionally, you can fully customize any part of the Phone Input through the overrides prop. The Phone Input consists of multiple subcomponents that are listed bellow and you can override each one of them. To help you identify the names of these subcomponents, you can highlight them through this selector:

+1

Note: You should always use longhand CSS properties. Mixing shorthands and longhands will lead into strange behaviors!

PhoneInput API

Warning any = "Prop types are not shown in dev mode"

extract-react-types is not being run in dev mode for speed reasons. If you need to see prop types add the environment variable FORCE_EXTRACT_REACT_TYPES eg:

  • FORCE_EXTRACT_REACT_TYPES=true yarn start <packageName>
  • FORCE_EXTRACT_REACT_TYPES=true yarn start:<team>

StatefulPhoneInput API

Warning any = "Prop types are not shown in dev mode"

extract-react-types is not being run in dev mode for speed reasons. If you need to see prop types add the environment variable FORCE_EXTRACT_REACT_TYPES eg:

  • FORCE_EXTRACT_REACT_TYPES=true yarn start <packageName>
  • FORCE_EXTRACT_REACT_TYPES=true yarn start:<team>

StatefulPhoneInputContainer API

Warning any = "Prop types are not shown in dev mode"

extract-react-types is not being run in dev mode for speed reasons. If you need to see prop types add the environment variable FORCE_EXTRACT_REACT_TYPES eg:

  • FORCE_EXTRACT_REACT_TYPES=true yarn start <packageName>
  • FORCE_EXTRACT_REACT_TYPES=true yarn start:<team>

CountrySelect API

Warning any = "Prop types are not shown in dev mode"

extract-react-types is not being run in dev mode for speed reasons. If you need to see prop types add the environment variable FORCE_EXTRACT_REACT_TYPES eg:

  • FORCE_EXTRACT_REACT_TYPES=true yarn start <packageName>
  • FORCE_EXTRACT_REACT_TYPES=true yarn start:<team>

CountrySelectDropdown API

Warning any = "Prop types are not shown in dev mode"

extract-react-types is not being run in dev mode for speed reasons. If you need to see prop types add the environment variable FORCE_EXTRACT_REACT_TYPES eg:

  • FORCE_EXTRACT_REACT_TYPES=true yarn start <packageName>
  • FORCE_EXTRACT_REACT_TYPES=true yarn start:<team>