0.2.0 • Published 8 years ago
app-flag v0.2.0
app-flag
A component that is capable of displaying all country flags with ISO 3166-1-alpha-2 codes.
Browsers Support
Prerequisites
- Install Node
>= 5.6.0
$ brew install node
- Install NPM
>= 3.8.0
$ npm update -g npm
Installation
Install the plugin via NPM:
$ npm install --save app-flag
How To Use
Option 1: CommonJS (ES6/ES2015)
import AppFlag from 'app-flag';
Option 2: Universal Module Definition
<script src="ASSET_HOST/react.min.js"></script>
<script src="ASSET_HOST/react-dom.min.js"></script>
<script src="ASSET_HOST/classnames.min.js"></script>
<script src="ASSET_HOST/app-component.min.js"></script>
<script src="ASSET_HOST/app-flag.min.js"></script>
Remember to copy the
flags
folder.
Props
code
The country ISO 3166-1-alpha-2 code.
propType: enumCountryCodes
defaultProp: 'ad'
path
The flag's path.
propType: string
defaultProp: 'flags'
size
The icon's size ratio.
propType: enum('rectangle'|'square')
defaultProp: 'rectangle'