# @phantasweng/vue-cryptocurrency-icons

> cryptocurrency icon component for vue3

Latest version **0.1.1** (published 2023-11-06) · CC0-1.0 license · 0 weekly downloads

## Install

```sh
npm install @phantasweng/vue-cryptocurrency-icons
pnpm add @phantasweng/vue-cryptocurrency-icons
yarn add @phantasweng/vue-cryptocurrency-icons
bun add @phantasweng/vue-cryptocurrency-icons
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; large bundle; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2023-11-06 |
| First published | 2023-11-06 |
| Weekly downloads | 0 |
| License | CC0-1.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 40.2 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Maintainers | phantas |
| Keywords | cryptocurrency, icons, icon, crypto, currency, cryptocurrencies, currencies, symbols, svg, png, vector, color, coin, bitcoin, ethereum, flat-icons, altcoin, altcoins, icon-pack, icon-set, erc20-tokens, erc20, erc721 |

## Links

- npm: https://www.npmjs.com/package/@phantasweng/vue-cryptocurrency-icons
- Repository: https://github.com/PhantasWeng/vue-cryptocurrency-icons
- Issues: https://github.com/PhantasWeng/vue-cryptocurrency-icons/issues
- npm.io page: https://npm.io/package/@phantasweng/vue-cryptocurrency-icons

## Dependencies (2)

- [vue](https://npm.io/package/vue.md) ^3.3.7
- [lodash](https://npm.io/package/lodash.md) ^4.17.21

## Alternatives

- [@fortawesome/react-fontawesome](https://npm.io/package/@fortawesome/react-fontawesome.md) — 2.2M weekly downloads
- [roboto-fontface](https://npm.io/package/roboto-fontface.md) — 196.0K weekly downloads
- [@react-native-vector-icons/common](https://npm.io/package/@react-native-vector-icons/common.md) — 150.4K weekly downloads
- [stockfish](https://npm.io/package/stockfish.md) — 27.0K weekly downloads
- [@procore/core-icons](https://npm.io/package/@procore/core-icons.md) — 4.6K weekly downloads

## Recent versions

- 0.1.1 (latest) — 2023-11-06
- 0.1.0 — 2023-11-06

## README

# Vue Cryptocurrency Icons

Inheriting image resources from [cryptocurrency-icons](https://github.com/spothq/cryptocurrency-icons) and writing a version that can be used in Vue 3.

The biggest difference is that the original cryptocurrency-icons need to import images directly from node_module, for example:

`import avax from './node_modules/cryptocurrency-icons/svg/color/avax.svg'`.

But in tools like Vite, it is not easy to import images directly from node_module. It requires some other configurations.

## Install 🚀

```bash
$ npm install @phantasweng/vue-cryptocurrency-icons
```

Vue Global on `main.js`

```js
import VueCryptocurrencyIcons from '@phantasweng/vue-cryptocurrency-icons'

app.use(VueCryptocurrencyIcons)
```

Component

```js
<VueCryptocurrencyIcons name="Avax" />
```

## Props

Prop | Options | Default | Description
---- | ---------| ------------ | -----
name | btc, eth, sol, usdc...etc | null | Please refer to the list of currency names in [manifest.json](./manifest.json).
type | svg, png | svg | Image Type
size | 32, 2x, 128, number (when type is png) | default is 32 when type is svg | Ignore when using svg. Please customize width and height with style.
theme | color | black,color, white | icon color


## Methods

### icons
取得 icons list

```js
import { icons } from '@phantasweng/vue-cryptocurrency-icons'
console.log(icons)

/**
 * [
 * 	{symbol: '$PAC', name: 'PACcoin', color: '#f5eb16'},
 *  ...
 * ]
*/
```

### getIcon
Manually get the icon's base64

```js
import { getIcon } from '@phantasweng/vue-cryptocurrency-icons'
getIcon({
  name: 'btc',
  type: 'svg',
  size: '32',
  theme: 'white',
}).then((res) => {
  console.log(res)
})
console.log(myIcon)
// {default: "data:image/svg+xml,%3csvg xmlns='http://www.w3.org….45c.975.243 4.118.696 3.61 2.733z'/%3e%3c/svg%3e"}
```

---
_Source: https://npm.io/package/@phantasweng/vue-cryptocurrency-icons · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
