Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/stephenway/react-flagkit
- Owner: stephenway
- License: mit
- Created: 2017-11-02T20:43:22.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-02-16T17:58:12.000Z (almost 2 years ago)
- Last Synced: 2024-10-18T09:16:06.484Z (2 months ago)
- Topics: flag-icons, flags, icons, react, webapp
- Language: TypeScript
- Homepage: https://stephenway.github.io/react-flagkit
- Size: 7.41 MB
- Stars: 36
- Watchers: 2
- Forks: 8
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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