
Product
Socket for Jira Is Now Available
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.
currency-code-to-country-flag
Advanced tools
React component to display country flags based on currency codes or country codes
A React component library for displaying country flags based on currency codes or country codes. The package includes local SVG flag files in both square (1:1) and rectangular (4:3) aspect ratios.

npm install currency-code-to-country-flag
You can use the CountryFlag component in two ways:
import { CountryFlag } from "currency-code-to-country-flag";
function App() {
return (
<div>
<CountryFlag currency="USD" />
<CountryFlag currency="EUR" />
<CountryFlag currency="JPY" />
<CountryFlag currency="LAK" />
<CountryFlag currency="THB" />
<CountryFlag currency="CNY" />
</div>
);
}
import { CountryFlag } from "currency-code-to-country-flag";
function App() {
return (
<div>
<CountryFlag country="US" />
<CountryFlag country="MM" />
<CountryFlag country="DE" />
</div>
);
}
import { CountryFlag } from "currency-code-to-country-flag";
function App() {
return (
<div>
<CountryFlag country="US" ratio="square" /> {/* Square flag (1:1) */}
<CountryFlag country="US" ratio="rectangle" /> {/* Rectangular flag (4:3) */}
</div>
);
}
| Prop | Type | Description | Default |
|---|---|---|---|
| currency | string | ISO 4217 currency code (e.g., 'USD', 'EUR', 'JPY') | - |
| country | string | ISO 3166-1 alpha-2 country code (e.g., 'US', 'DE') | - |
| size | '16' | '24' | '32' | '48' | '64' | Size of the flag image in pixels | '32' |
| ratio | 'square' | 'rectangle' | Aspect ratio of the flag (square 1:1 or rectangular 4:3) | 'square' |
| alt | string | Custom alt text for the flag image | Auto-generated |
| className | string | Additional CSS class names | '' |
| style | React.CSSProperties | Additional inline styles | {} |
currency or country prop must be provided.country takes precedence.Flag icons provided by flag-icons project.
MIT
FAQs
React component to display country flags based on currency codes or country codes
The npm package currency-code-to-country-flag receives a total of 212 weekly downloads. As such, currency-code-to-country-flag popularity was classified as not popular.
We found that currency-code-to-country-flag demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.