crypto-token-icon
v0.0.23
Published
Crypto token icon.
Downloads
628
Readme
Install package
yarn add @mui/icons-material @mui/material @emotion/styled @emotion/react crypto-token-icon
Using nomal
import { IconHT, IconHTX } 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 = TokenName.BTC;
import { mapNameToIcon, SvgComponent } from 'crypto-token-icon';
const x: SvgComponent = mapNameToIcon['BTC'];
import { WalletName } from 'crypto-token-icon';
WalletName.metaMask;
import { IconAndName } from 'crypto-token-icon'
<IconAndName tokenName={TokenName.BTC} />
<IconAndName tokenName={TokenName.BTC} reverse={true} />
Prepare when dev package
prepare for vite:
yarn add @types/node vite-plugin-dts