Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/stephenway/react-flagkit

πŸ‡ΊπŸ‡¦ React wrapper for FlagKit Flag Icons
https://github.com/stephenway/react-flagkit

flag-icons flags icons react webapp

Last synced: about 2 months ago
JSON representation

πŸ‡ΊπŸ‡¦ React wrapper for FlagKit Flag Icons

Awesome Lists containing this project

README

        

# react-flagkit

Beautiful flag icons for usage in React webapps. All flags are provided as importable images by React.

## Documentation

- [FlagKit Country Codes][1]

## Installation

```shell
npm install --save react-flagkit

// or

yarn add react-flagkit
```

## Usage

```js
import Flag from 'react-flagkit';

export default () => ;
```

Displays the flag of the United States (US)

```js

```

Component can render different flags by country, a list of all codes can be found [here](https://github.com/madebybowtie/FlagKit/blob/master/Assets/Flags.md).

```js

```

It's also possible to make those flags whatever pixel size you want.

Big

```js

```

or small

```js

```

If needed you can also make the flag interactive with an `onClick` handler, just make sure to change the `role` to `button`

```js
{
alert('You just clicked on the flag.');
}}
/>
```

## Thanks

- **madebybowtie** for FlagKit
- **jsDelivr** for free CDN access

[1]: https://github.com/madebybowtie/FlagKit/blob/master/Assets/Flags.md