crypto-token-icon
v0.0.14
Published
Crypto token icon.
Downloads
85
Readme
Install package
yarn add @mui/icons-material @mui/material @emotion/styled @emotion/react crypto-token-icon
Using nomal
import { IconBTC, IconETH } from 'crypto-token-icon';
function App() {
return (
<>
<IconHT />
<IconHTX />
</>
);
}
Incase unknow token name
import { Icon } from 'crypto-token-icon';
function App() {
return (
<>
<Icon tokenName={'BTC'} sx={{ fontSize: '40px' }} />
<Icon tokenName={'other string' as any} sx={{ fontSize: '40px' }} />
</>
);
}
Some useful type and data support
import { TokenName } from 'crypto-token-icon';
const x: TokenName = 'BTC';
import { mapNameToIcon, SvgComponent } from 'crypto-token-icon';
const x: SvgComponent = mapNameToIcon['BTC'];
import { WalletName } from 'crypto-token-icon';
WalletName.metaMask;
Prepare when dev package
prepare for vite:
yarn add @types/node vite-plugin-dts