1.0.5 • Published 3 years ago
next-crypto-icons v1.0.5
Crypto Icons for Next.js
Uses the cryptocurrency-icons
package, served from the
JsDelivr CDN, to
render a cryptocurrency icon easily.
Given a name
, style
, and size
, the <CryptoIcon />
component will render
a next/image
with a given { width, height } = size
and a src
of:
`https://cdn.jsdelivr.net/npm/cryptocurrency-icons@latest/svg/${style}/${name}.svg`;
Example
// from demo/index.tsx
const DemoHome = () => {
return (
<div style={{ display: 'flex', gap: '2rem', padding: '2rem' }}>
<CryptoIcon name="btc" />
<CryptoIcon name="eth" />
<CryptoIcon name="sol" />
</div>
);
};
export default DemoHome;
Renders the following 3 icons: