Skip to content

3phase/cute-countries-react

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cute-countries-react

Beautiful country flag icons for React. All flags are provided as importable images by React.

Documentation and Playground

Available Icons

  • All available icons can be found here.

Installation

npm install --save cute-countries-react

or

yarn add cute-countries-react

Usage

import Flag from 'cute-countries-react';

Displays the flag of the United States (US)

<Flag country="us" />

Component can render different flags by country, a list of all codes can be found here.

<Flag country="de" />

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

Big

<Flag country="ca" size={84} />

or small

<Flag country="uk" size={15} />

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

<Flag
  country="se"
  role="button"
  onClick={() => {
    alert('You just clicked on the flag.');
  }}
/>

Thanks

About

🇬🇧 Cute country flags for React

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 89.6%
  • JavaScript 10.0%
  • CSS 0.4%