Vue Unicons

3.3.1 · active · verified Sun Apr 19

vue-unicons is a library that provides access to over 1000 pixel-perfect SVG icons from the Iconscout Unicons collection, integrated directly as Vue components. The current stable version is 3.3.1. Releases occur periodically, often tied to updates in the upstream Unicons library, alongside bug fixes and minor feature enhancements. Key differentiators include its simple integration into Vue 2 and Vue 3 projects, offering both line and monochrome icon styles, and allowing for global configuration of icon properties like `fill`, `height`, and `width`. It simplifies icon management by making each icon a reusable Vue component, contrasting with traditional icon font or raw SVG sprite approaches.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to globally register specific Unicons for a Vue 3 application, set default properties, and then use them in a template. It covers importing the plugin and individual icons, and applying global configuration.

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

// Add the desired icons to the Unicon library
Unicon.add([uniLayerGroupMonochrome, uniCarWash])

// Install Unicon as a Vue plugin, optionally with global configuration
createApp(App)
  .use(Unicon, {
    fill: 'deeppink',
    height: 32,
    width: 32
  })
  .mount('#app')

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

view raw JSON →