Flags World React
React component for displaying world flags using separate SVG files.
- 🌐 Flags of all countries in SVG format.
- 🎨 Customizable sizes and styles.
✨ Installation
Installed the package from npm:
npm i flags-world-react
✨ Usage
Import the Flag component into your file JSX:
import { Flag } from "flags-world-react";
Use the Flag component in your file JSX:
<Flag countryCode="JP" />
<Flag countryCode="JP" width={50} height={30} className="custom-flag" />
<Flag countryCode="JP" style={{ borderRadius: "4px", border: "2px solid red" }} />
✨ Props
Property | Type | Description |
---|---|---|
countryCode |
string |
Country code in format ISO 3166-1 alpha-2 (eg: US, FR, ES) |
width |
number |
Flag width in pixels (default 100px) |
height |
number |
Flag height in pixels (default 60px) |
className |
string |
Custom class name for the flag element |
style |
object |
Inline style object to apply directly to SVG element |
Website (254 flags)
List of flags (254 flags)