Package Exports
- react-native-country-flag
- react-native-country-flag/dist/cjs/index.js
- react-native-country-flag/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-native-country-flag) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
react-native-country-flag
This is a react-native package to display every 254 country flag with the ISO 3166-1 alpha-2 Standard!

π Table of Contents
β¬οΈ Install package
npm install --save react-native-country-flag
πΎ Data
Data required for the countryflag component to work has been completely decoupled from the library. That gives developers the flexibility to better control their app bundle size and let them choose how and when this data is loaded. Data can be:
Usage with remotely Fetched flags
- Pros: Data fetched only when needed, does not affect your app bundle size
- Cons: Network latency, doesnβt work offline
import CountryFlag from "react-native-country-flag";
<CountryFlag isoCode="de" size={25} />Usage with flags directly Bundled into your codebase
π§ Note: Still in progress (probely available in v2.1)
- Pros: Component renders instantly, data is available offline
- Cons: Does affect your app bundle size
npm install --save react-native-country-flag/dataimport CountryFlag from "react-native-country-flag";
import flags from "react-native-country-flag/data";
<CountryFlag isoCode="de" size={25} flags={flags} />
π© Flag component (props)
import CountryFlag from "react-native-country-flag";
<CountryFlag isoCode="de" size={25} />You can only use the ISO 3166-1 alpha-2 Standard for the isoCode property.
| Prop | Type | Desciption |
|---|---|---|
| isoCode | String | Define the country flag with the ISO 3166-1 alpha-2 Standard. |
| size | Integer | Define the size from the country flag. |
| style | Stylesheet | Customize the style from the CountryFlag component. |
| flags | Optional: pass bundeled flags CountryFlag component. |
π License
MIT Β© Yannis Hofmann