free-flags-icons

Icons from freeflagicons.com


Keywords
flags, images, countries
Licenses
NTP/O-UDA-1.0
Install
npm install free-flags-icons@0.1.0

Documentation

Free Flag Icons

This package is simply a scraper for freeflagicons.com. As of right now, it only contains the Flag Background style but it would be trivial to add others (just submit an issue).

These images are free for personal usage, but you must pay for a commercial license. See the site and their license for more details.

Usage

Start by installing the package...

npm install free-flag-icons

Then include them through the path to the given style (e.g. free-flag-icons/[style]/us.jpg). For example, if you're using a bundler like parcel or webpack that supports import-ing images:

import USFlag from 'free-flag-icons/flag_background/us.jpg'

The ISO two-letter country codes are used for each country which makes the images really easy to consume programmatically. For example in parcel, you can...

import flagImages from 'free-flag-icons/flag_background/*.jpg'

// Use some `countryCode` variable to automatically pluck the right image
flagImages[countryCode]

Contributing

Contributions are welcome, just create an issue or pull request. My goal is to keep this package extremely simple. The most common change is likely just to add a new flag style.