1.1.7 • Published 5 months ago

react-country-icons v1.1.7

Weekly downloads
-
License
MIT
Repository
-
Last release
5 months ago

React Country Icons

A lightweight React component library for displaying country flags. Easily render flags of any country using their ISO 3166-1 alpha-2 country codes.

Installation

Install the package using npm:

npm install react-country-icons

Or using yarn:

yarn add react-country-icons

Usage

Import the Flag component and use it in your React application:

import React from 'react'
import Flag from 'react-country-icons'

const App: React.FC = () => {
    return (
        <div>
            <Flag size={32} country="DE"/> {/* German flag */}
            <Flag size={48} country="US"/> {/* US flag */}
            <Flag size={24} country="FR"/> {/* French flag */}
            <Flag size={32} square country="TR"/> {/* Turkish flag in square form */}
        </div>
    )
}

export default App

Props

PropTypeDescriptionExample
sizenumberHeight of the flag in pixels.32
countrystringISO 3166-1 alpha-2 country code."DE"
squarebooleanForms icon into square shapetrue

Supported Country Codes

The package supports all ISO 3166-1 alpha-2 country codes. Here are some examples:

  • DE - Germany
  • US - United States
  • FR - France
  • GB - United Kingdom
  • JP - Japan

For a full list of country codes, refer to the ISO 3166-1 alpha-2 standard.


License

This project is licensed under the MIT License.

Acknowledgments

  • Flag images sourced from Wikipedia.

  • Built with React and TypeScript.

Author

npm: melihfirat

github: firatmelih

1.1.7

5 months ago

1.1.6

5 months ago

1.1.5

5 months ago

1.1.4

5 months ago

1.1.3

5 months ago

1.1.2

5 months ago

1.1.1

5 months ago

1.1.0

5 months ago

1.0.9

5 months ago

1.0.8

5 months ago

1.0.7

5 months ago

1.0.6

5 months ago

1.0.5

5 months ago

1.0.4

5 months ago

1.0.3

5 months ago

1.0.2

5 months ago

1.0.1

5 months ago

1.0.0

5 months ago