Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

flags-world-react

elovejo47MIT1.0.16

React component for displaying world flags using separate SVG files.

react, flags, svg, world flags

readme

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)