flagit

2.0.6 • Public • Published

Flagit 🇮🇳

Flagit is the smallest npm package to display flags from about 242 supported countries that can be used as a react component.

View the live demo

How to use:

import Country from "flagit";

Then use the component by passing appropriate props as described below:

Example:

<Country countryShort="IN" size="md" />

OR

<Country countryShort="IN" size="28" />

Props:

Props Values Description
countryShort as per https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements Pass country code in this prop eg: IN, US, AU
size sm, md, lg, xl, xxl
OR
Any size between 16 to 64 pixels
sm=16w x 16h
md=24w x 24h
lg=32w x 32h
xl=48w x 48h
xxl=64w x 64h
in pixels

Note:

  • Default size is set to sm OR 16
  • Removed customWidth and customHeight props, as the width and height are in proportion

Package Sidebar

Install

npm i flagit

Weekly Downloads

109

Version

2.0.6

License

ISC

Unpacked Size

116 kB

Total Files

3

Last publish

Collaborators

  • tusharjo9