npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vue-unicons

v3.3.1

Published

1000+ Pixel-perfect svg icons for your next project as Vue components

Downloads

17,093

Readme

1000+ Pixel-perfect svg unicons for your next project as Vue components

Supporting

Vue Unicons is open source project and completely free to use.

If you like the project, you can donate to support the development via the following methods:

Donate via Patreon Donate via PayPal Donate via Bitcoin

Demo

https://antonreshetov.github.io/vue-unicons

Developed with love for developers

A simple way to add the necessary icons and install them.

Install

NPM

Installing with npm is recommended and it works seamlessly with webpack.

npm i vue-unicons

Download

You can download latest version from the Github: Download

Quick start

Global

To use in your project:

  1. Import vue-unicons
  2. Grab the icons you want and add then into Unicon library
  3. Install Unicon into Vue

main.js

Vue 3

import { createApp } from 'vue'
import App from './App.vue'
import Unicon from 'vue-unicons'
import { uniLayerGroupMonochrome, uniCarWash } from 'vue-unicons/dist/icons'

Unicon.add([uniLayerGroupMonochrome, uniCarWash])

createApp(App).use(Unicon).mount('#app')

Vue 2

import Vue from 'vue'
import App from './App.vue'
import Unicon from 'vue-unicons/dist/vue-unicons-vue2.umd'
import { uniLayerGroupMonochrome, uniCarWash } from 'vue-unicons/dist/icons'

Unicon.add([uniLayerGroupMonochrome, uniCarWash])
Vue.use(Unicon)

new Vue({
  render: h => h(App)
}).$mount('#app')

App.vue

Use the name of icon without the uni prefix, icon style and in the kebab-case: uniCarWash -> car-wash uniLayerGroupMonochrome -> layer-group

<template>
  <div>
    <unicon name="car-wash" fill="limegreen"></unicon>
    <unicon name="layer-group" fill="royalblue" icon-style="monochrome"></unicon>
  </div>
</template>

Config

You can configure the icons globally. Simply specify the required parameters during installation.

...
createApp(App)
  .use(Unicon, {
    fill: 'deeppink',
    height: 32,
    width: 32
  })
  .mount('#app')

Add custom icons

No icons you need? No problem, you can add custom svg icons.

custom-icons.js

// Always use a prefix to avoid coincidence with existing icons.
export const myCustomIcon = {
  name: 'my-custom-icon',
  style: 'line',
  path: '<path d="M16.327 10.775a.312.312 0 0...</path>' // Copy everything inside the svg tag of the icon you want and past there
}

For correct positioning of svg icon please make sure that the icon to be added has viewBox="0 0 X X"

main.js

import { createApp } from 'vue'
import App from './App.vue'
import Unicon from 'vue-unicons'
import { uniLayerGroupMonochrome, uniCarWash } from 'vue-unicons/dist/icons'
import { myCustomIcon } from './custom-icons'

Unicon.add([uniLayerGroupMonochrome, uniCarWash, myCustomIcon])

createApp(App).use(Unicon).mount('#app')

App.vue

<template>
  <div>
    <unicon name="constructor" fill="royalblue"></unicon>
    <unicon name="car-wash" fill="limegreen"></unicon>
    <unicon name="my-custom-icon" fill="royalblue" />
  </div>
</template>

See example

Nuxt

Installation in Nuxt is almost the same, except that you need to create a separate file in the plugins folder:

plugins/vue-unicons.js

import Vue from 'vue'
import Unicon from 'vue-unicons/dist/vue-unicons-vue2.umd'
import { uniLayerGroupMonochrome, uniCarWash } from 'vue-unicons/dist/icons'

Unicon.add([uniLayerGroupMonochrome, uniCarWash])
Vue.use(Unicon)

Then we add the file path inside the plugins key in nuxt.config.js, and set mode: 'client' to make vue-unicons work only in a browser.

  ...
  plugins: [
    { src: '~/plugins/vue-unicons', mode: 'client' }
  ]
  ...
<template>
  <div>
    <client-only>
      <unicon name="car-wash" fill="limegreen"></unicon>
      <unicon name="layer-group" fill="royalblue" icon-style="monochrome"></unicon>
    </client-only>
  </div>
</template>

Props

| Name | Description | Type | Accepted values | Default value | | ------------ | ------------------ | -------- | ----------------- | ------------- | | name | Icon name | string | - | - | | width | Width of icon | string | - | - | | height | Height of icon | string | - | - | | fill | Fill color of icon | string | HEX or color name | - | | hover-fill | Fill color on hover| string | HEX or color name | - | | icon-style | Icon style | string | line / monochrome | line |

Events

| Name | Description | Payload | | ------- | ------------------------------- | ------- | | click | Triggered when icon was clicked | - |

License

Vue Unicons licensed under MIT.

Unicons licensed under Apache 2.0