react-world-flags icon indicating copy to clipboard operation
react-world-flags copied to clipboard

exclude country from list ?

Open lnxfsf opened this issue 1 year ago • 1 comments

can we exclude country from list ?
or have a list, of what are supported countries to show in list dropdown ?

lnxfsf avatar Jul 03 '24 14:07 lnxfsf

Try the latest beta npm install [email protected] - it exposes a list of all flags. You can use it like this:

import Flag, { countries } from "react-world-flags";

And then something like

{countries.map((country) => (
  <div key={country.alpha2} className="flex items-center gap-2">
    <Flag code={country.alpha2} className="w-4 h-4" />
    {country.name}
  </div>
))}

smucode avatar Dec 13 '25 22:12 smucode