Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
@onramper/flag-icons
Advanced tools
Readme
This a package for exporting SVG files as React components. The SVG files were imported using Figma API.
FIGMA_TOKEN=$YOUR_TOKEN
FILE_ID=$YOUR_FILE_ID
Follow these instructions to get or create your Figma access token.
The file id can be easily retrieved by accessing your figma file on your browser where you have to extract the value from the URL:
https://www.figma.com/file/`${YOUR_FILE_ID}`/my_figma_file_name
Create a page inside your figma file called 'flags', and add your icons (should be grouped into components)
Run export
$ num run export
The icons added to the 'flag' page will get exported as SVG under a folder with the same name.
npm run build
The build script will export the SVG files from multiple locations (specified in the code as input). The result will be React components for each of the files found.
During the build process, some additional components are constructed to render a specific icon based on a given name, which can be country code or currency ID. For example, the following component should render the flag of United Kindom:
<CountryIcon name="UK" />
These aggregator components are built using the icons-aggregator.js
script.
The following input is received by the algorithm:
const components = [
{
name: "CountryIcon",
dictionary: {
AX: "AlandIslandsIcon",
AF: "AfghanistanIcon",
[...]
}
},
{
name: "CurrencyIcon",
dictionary: {
AUD: "AustraliaIcon",
GBP: "UnitedKingdomIcon",
[...]
}
}
];
FAQs
This a package for exporting as React components the SVG files related to flag of countries or of other entities.
The npm package @onramper/flag-icons receives a total of 101 weekly downloads. As such, @onramper/flag-icons popularity was classified as not popular.
We found that @onramper/flag-icons demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 open source maintainers 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
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.