
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
react-currency-flags
Advanced tools
Using the images from transferwise/currency-flags, this library uses styled-components
to create React components for use in your app. Please be aware that the images are in base64 format, so if you are concerned with the bundle size, I suggest that you clone the aforementioned TransferWise's repo and store it in a CDN solution of your own (the distributed format that repo is also base64 when built, so simply installing that module won't work).
$ yarn add react-currency-flags
$ npm install react-currency-flags
import CurrencyFlag from 'react-currency-flags';
const CurrencyFlagComponent1 = () => <CurrencyFlag currency="USD" size="sm" />;
const CurrencyFlagComponent2 = () => <CurrencyFlag currency="EUR" width={38} />;
sm
, md
, lg
, xl
You should provide either the size
, or width
or height
; size
will take precedence if all values are provided.
See examples in the examples
folder.
While SVG provides the advantage of scaling, but some flags, such as Mexico's, are very complicated graphically, and would therefore create incredibly large file sizes.
FAQs
React styled-component for currency flags
The npm package react-currency-flags receives a total of 4,553 weekly downloads. As such, react-currency-flags popularity was classified as popular.
We found that react-currency-flags demonstrated a not healthy version release cadence and project activity because the last version was released 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.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.