Socket
Book a DemoInstallSign in
Socket

coin-icon

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

coin-icon

Cryptocurrency icons

1.1.4
latest
Source
npmnpm
Version published
Weekly downloads
1
-96.15%
Maintainers
1
Weekly downloads
 
Created
Source

coin-icon

Cryptocurrency icons set

DEMO

install

npm i coin-icon

Glossary

CoinIcon

Optimazed way to use icons, since the icon is loading through URL.

Gettting started

  • Fist of all you need to define the path for storing icons files. For example - images/svg;
  • Copy all svg icons from svg (github repo) to your public folder 'images/svg;
  • Set up CoinIconProvider with public folder path:
<CoinIconProvider folderPath="'images/svg">
    <App />
</CoinIconProvider>
  • Import CoinIcon to your code:
import { CoinIcon } from 'coin-icon';

<CoinIcon code="btc" />;

Details

  • Icon's width and heigth are equal to 1em by default. To change icon's size change the font-size of parent or current tag.
  • Contains all properties declared in HTMLAttributes<HTMLDivElement> interface from @types/react package and custom properties described below:
PropertyTypeRequiredDescription
codeCoinIconCodeNoTypeScript literal type of icon code
urlstringNoImage URL. For a case, when icon for a code is missing

Add new icon

  • Add new svg file into svg folder
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
    <title>new-coin</title>
    ...
</svg>

Make sure that width and height property are removed.

  • Add to src/interfaces/index.ts file:
export const CoinIconNameList = [
    ...
    /* start */
    'new-icon',
    /* end */
    ...
];
  • Create Pull Request

Keywords

react

FAQs

Package last updated on 12 Dec 2021

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.