react-circle-flags
Version:
A React component with a collection of 300+ minimal circular SVG country flags
58 lines (36 loc) • 1.92 kB
Markdown
# react-circle-flags
> React circle flags (based on [circle-flags](https://github.com/HatScripts/circle-flags))
[](https://www.npmjs.com/package/react-circle-flags) [](https://standardjs.com) [](https://codecov.io/gh/on-the-edge-cloud/react-circle-flags) 
## Install
```bash
npm install --save react-circle-flags
```
## Usage
```jsx
import React from 'react'
import { CircleFlag } from 'react-circle-flags'
export const ArgentinianFlag = () => <CircleFlag countryCode="ar" height="35" />
```
### With custom CDN
```jsx
import React from 'react'
import { CircleFlag } from 'react-circle-flags'
export const ArgentinianFlag = () => <CircleFlag countryCode="ar" height="35" cdnUrl="https://magic-cdn.com/flags/" />
```
### With inline svgs instead of using images
```jsx
import React from 'react'
import { CircleFlag } from 'react-circle-flags'
export const ArgentinianFlag = () => <CircleFlag countryCode="ar" height="35" cdnUrl="https://magic-cdn.com/flags/" />
```
You can pass all the react's `React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>` props to CircleFlag. :rocket:
### Language flags
```jsx
import React from 'react'
import { CircleFlagLanguage } from 'react-circle-flags'
export const EnglishFlag = () => <CircleFlagLanguage languageCode="en-us" height="35" />
```
## Docs && Gallery
Click [here]([https://on-the-edge-cloud.github.io/react-circle-flags/](https://on-the-edge-cloud.github.io/react-circle-flags/))!
## License
MIT © [On The Edge IT Solutions](https://github.com/on-the-edge-cloud)