Flags

The flags plugin adds country flags as CSS classes, for language switchers, address forms and phone number fields.

Installation

The flags are a plugin. Include tabler-flags.css or tabler-flags.min.css in your page to enable them.

You can also include the plugin via CDN:

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@tabler/[email protected]/dist/css/tabler-flags.min.css" />

Flag

Add the flag class to an element and a country class from the list below.

<span class="flag flag-country-us"></span>

Country flags

The country class is flag-country- followed by the two-letter country code, for example .flag-country-ad for Andorra. The full list is at the end of this page.

<span class="flag flag-country-tg"></span>
<span class="flag flag-country-br"></span>
<span class="flag flag-country-pt"></span>

Flag sizes

Add a size class from flag-xs to flag-xl to scale the flag. The names follow the usual Bootstrap pattern.

<span class="flag flag-xl flag-country-us"></span>
<span class="flag flag-lg flag-country-us"></span>
<span class="flag flag-md flag-country-us"></span>
<span class="flag flag-sm flag-country-us"></span>
<span class="flag flag-xs flag-country-us"></span>

Flags list

All available countries:

FlagNameCountry codeCSS class
Andorraad.flag-country-ad
United Arab Emiratesae.flag-country-ae
Afghanistanaf.flag-country-af
Antiguaag.flag-country-ag
Anguillaai.flag-country-ai
Armeniaam.flag-country-am
Angolanao.flag-country-ao
Antarcticaaq.flag-country-aq
Argentinaar.flag-country-ar
American Samoaas.flag-country-as
Austriaat.flag-country-at
Australiaau.flag-country-au
Arubaaw.flag-country-aw
Aslan Islandsax.flag-country-ax
Azerbaijanaz.flag-country-az
Bosnianba.flag-country-ba
Barbadosbb.flag-country-bb
Belgiumbe.flag-country-be
Burkina Fasobf.flag-country-bf
Bulgariabg.flag-country-bg
Bahrainbh.flag-country-bh
Burundibi.flag-country-bi
Beninbj.flag-country-bj
Saint-Barthélemybl.flag-country-bl
Bermudabm.flag-country-bm
Bruneianbn.flag-country-bn
Boliviabo.flag-country-bo
Bonairebq-bo.flag-country-bq-bo
Brazilbr.flag-country-br
Bahamasbs.flag-country-bs
Bhutanbt.flag-country-bt
Bouvet Islandbv.flag-country-bv
Batswanabw.flag-country-bw
Belarusby.flag-country-by
Belizebz.flag-country-bz
Canadaca.flag-country-ca
Cocos Islandcc.flag-country-cc
Democratic Republic of Congocd.flag-country-cd
Central African Republiccf.flag-country-cf
Republic of the Congocg.flag-country-cg
Switzerlandch.flag-country-ch
Ivory Coastci.flag-country-ci
Cook Islandck.flag-country-ck
Chilecl.flag-country-cl
Camerooncm.flag-country-cm
Chinacn.flag-country-cn
Colombiaco.flag-country-co
Costa Ricacr.flag-country-cr
Cubacu.flag-country-cu
Cape Verdecv.flag-country-cv
Curacaocw.flag-country-cw
Christmas Islandcx.flag-country-cx
Cypruscy.flag-country-cy
Czech Republiccz.flag-country-cz
Germanyde.flag-country-de
Djiboutidj.flag-country-dj
Denmarkdk.flag-country-dk
Dominicadm.flag-country-dm
Dominican Republicdo.flag-country-do
Algeriadz.flag-country-dz
Ecuadorec.flag-country-ec
Estoniaee.flag-country-ee
Egypteg.flag-country-eg
Sahrawieh.flag-country-eh
Eritreaer.flag-country-er
Spaines.flag-country-es
Ethiopiaet.flag-country-et
European Unioneu.flag-country-eu
Finlandfi.flag-country-fi
Fijifj.flag-country-fj
Falkland Islandsfk.flag-country-fk
Federate States of Micronesiafm.flag-country-fm
Faroe Islandsfo.flag-country-fo
Francefr.flag-country-fr
Gabonga.flag-country-ga
Great Britaingb.flag-country-gb
Englandgb-eng.flag-country-gb-eng
Nothern Irelandgb-nir.flag-country-gb-nir
Scotlandgb-sct.flag-country-gb-sct
Walesgb-wls.flag-country-gb-wls
Grenadagd.flag-country-gd
Georgiage.flag-country-ge
Guyanagf.flag-country-gf
Guernseygg.flag-country-gg
Ghanagh.flag-country-gh
Gibraltargi.flag-country-gi
Greenlandgl.flag-country-gl
Gambiagm.flag-country-gm
Guineagn.flag-country-gn
Guadeloupegp.flag-country-gp
Equatorial Guineagq.flag-country-gq
Greecegr.flag-country-gr
South Georgiags.flag-country-gs
Guatemalagt.flag-country-gt
Guamgu.flag-country-gu
Guinea-Bissaugw.flag-country-gw
Guyanagy.flag-country-gy
Hong Konghk.flag-country-hk
Heard and McDonald Islandshm.flag-country-hm
Hondurashn.flag-country-hn
Croatiahr.flag-country-hr
Haitiht.flag-country-ht
Hungaryhu.flag-country-hu
Indonesiaid.flag-country-id
Irelandie.flag-country-ie
Israelil.flag-country-il
Isle of Manim.flag-country-im
Indiain.flag-country-in
British Indian Ocean Territoryio.flag-country-io
Iraqiq.flag-country-iq
Iranir.flag-country-ir
Icelandis.flag-country-is
Italyit.flag-country-it
Jerseyje.flag-country-je
Jamaicajm.flag-country-jm
Jordanjo.flag-country-jo
Japanjp.flag-country-jp
Kenyake.flag-country-ke
Kyrgyzstankg.flag-country-kg
Cambodiakh.flag-country-kh
Kiribatiki.flag-country-ki
Comoroskm.flag-country-km
Saint Kitts and Neviskn.flag-country-kn
North Koreakp.flag-country-kp
South Koreakr.flag-country-kr
Kuwaitkw.flag-country-kw
Cayman Islandsky.flag-country-ky
Kazakhstankz.flag-country-kz
Laosla.flag-country-la
Lebaneselb.flag-country-lb
Saint Lucialc.flag-country-lc
Liechtensteinli.flag-country-li
Sri Lankalk.flag-country-lk
Liberialr.flag-country-lr
Lesothols.flag-country-ls
Lithuanialt.flag-country-lt
Luxembourglu.flag-country-lu
Latvialv.flag-country-lv
Libyaly.flag-country-ly
Moroccoma.flag-country-ma
Monacomc.flag-country-mc
Moldovamd.flag-country-md
Montenegrome.flag-country-me
Saint Martinmf.flag-country-mf
Madagascarmg.flag-country-mg
Marshall Islandsmh.flag-country-mh
Macedoniamk.flag-country-mk
Maliml.flag-country-ml
Myanmarmm.flag-country-mm
Mongoliamn.flag-country-mn
Macaomo.flag-country-mo
Nothern Mariana Islandsmp.flag-country-mp
Martiniquemq.flag-country-mq
Mauritaniamr.flag-country-mr
Montserratms.flag-country-ms
Maltamt.flag-country-mt
Mauritiusmu.flag-country-mu
Maldivesmv.flag-country-mv
Malawimw.flag-country-mw
Mexicomx.flag-country-mx
Malaysiamy.flag-country-my
Mozambiquemz.flag-country-mz
Namibiana.flag-country-na
New Caledonianc.flag-country-nc
Nigerne.flag-country-ne
Norfolk Islandnf.flag-country-nf
Nigeriang.flag-country-ng
Nicaraguani.flag-country-ni
Norwayno.flag-country-no
Nepalnp.flag-country-np
Nauruannr.flag-country-nr
Nigernu.flag-country-nu
New Zealandnz.flag-country-nz
Omanom.flag-country-om
Panamapa.flag-country-pa
Perupe.flag-country-pe
French Polynesiapf.flag-country-pf
Papua New Guineapg.flag-country-pg
Philippinesph.flag-country-ph
Pakistanpk.flag-country-pk
Polandpl.flag-country-pl
Saint Pierrepm.flag-country-pm
Pitcairn Islandspn.flag-country-pn
Puerto Ricopr.flag-country-pr
Palestineps.flag-country-ps
Portugalpt.flag-country-pt
Palaupw.flag-country-pw
Paraguaypy.flag-country-py
Qatarqa.flag-country-qa
Reunion Islandre.flag-country-re
Romaniaro.flag-country-ro
Serbiars.flag-country-rs
Russiaru.flag-country-ru
Rwandarw.flag-country-rw
Saudi Arabiasa.flag-country-sa
Solomon Islandssb.flag-country-sb
Seychellessc.flag-country-sc
Sudansd.flag-country-sd
Swedense.flag-country-se
Singaporesg.flag-country-sg
Saint Helenash.flag-country-sh
Sloveniasi.flag-country-si
Svalbard Islandsj.flag-country-sj
Slovakiask.flag-country-sk
Sierra Leonesl.flag-country-sl
San Marinosm.flag-country-sm
Senegalsn.flag-country-sn
Somaliaso.flag-country-so
Surinamesr.flag-country-sr
South Sudanss.flag-country-ss
Sao Tomest.flag-country-st
El Salvadorsv.flag-country-sv
Sint Maartensx.flag-country-sx
Syriasy.flag-country-sy
Swazilandsz.flag-country-sz
Turks and Caicostc.flag-country-tc
Chadtd.flag-country-td
French Southern and Antarctic Landstf.flag-country-tf
Togotg.flag-country-tg
Thailandth.flag-country-th
Tajikistantj.flag-country-tj
Tokelautk.flag-country-tk
Timor Lestetl.flag-country-tl
Turkmenistantm.flag-country-tm
Tunisiatn.flag-country-tn
Tongato.flag-country-to
Turkeytr.flag-country-tr
Trinidad and Tobagott.flag-country-tt
Tuvalutv.flag-country-tv
Taiwantw.flag-country-tw
Tanzaniatz.flag-country-tz
Ukraineua.flag-country-ua
Ugandaug.flag-country-ug
United States Minor Islandsum.flag-country-um
United States of Americaus.flag-country-us
Uruguayuy.flag-country-uy
Uzbekistanuz.flag-country-uz
Vatican Cityva.flag-country-va
Saint Vincentvc.flag-country-vc
Venezuelave.flag-country-ve
British Virgin Islandsvg.flag-country-vg
Virgiin Islandsvi.flag-country-vi
Vietnamvn.flag-country-vn
Vanuatuvu.flag-country-vu
Wallis and Futunawf.flag-country-wf
Samoaws.flag-country-ws
Yemenye.flag-country-ye
South Africaza.flag-country-za
Zambiazm.flag-country-zm
Zimbabwezw.flag-country-zw

Accessibility

  • A flag is a picture, not a language and not a country name. Always put the name in text next to it, or in an aria-label.
  • Many languages are spoken in more than one country, and many countries in more than one language. A flag on a language switcher is ambiguous - use the language name, written in that language.
  • The flag element is decoration, so keep it out of the reading order with aria-hidden="true" when the name is already there.
  • Do not use a flag as the only mark of a selected option.

Class reference

Every class this component ships, grouped by what it changes. A name in braces stands for a family — {color} is any base color, {breakpoint} any responsive step.

flag componentContainer element, a rounded rectangle holding one flag
flag-country-{code} colorThe country to show, by ISO code - for example flag-country-pl or flag-country-us
flag-{size} sizeFrom flag-xxs to flag-2xl; the default matches an avatar