@eyes22798/svg-icon

a svg icon component use in vue
941 3
Install
npm install @eyes22798/svg-icon
Latest Version:1.0.14
Vue:2
License:MIT
Last Updated:Jun 9, 2026
Links: GitHub  ·  npm
Maintainer: eyes22798

svg-icon

A lightweight component with no dependecy to allow use of custom SVG icons in your Vue.js application based on SVG sprite.

Installation

Using NPM:

npm install @eyes22798/svg-icon --save

Using Yarn:

yarn add @eyes22798/svg-icon

Requirements

  • Vue.js (2.x+)
  • svgxuse polyfill to support IE9-11 version
  • SVG sprite file that should be available in "/assets/icons" folder (can be changed, changed in vue.config.js)

Usage

In your main.js file:

import SvgIcon from '@eyes22798/svg-icon'

Vue.use(SvgIcon)

In your vue.config.js

You can customize the component name and icon assets dir

const SvgIconConfig = require('@eyes22798/svg-icon/webpack')

module.exports = {
  chainWebpack: (config) => {
    SvgIconConfig({ config, iconPath: './src/assets/icons', name: 'svg-icon' })
  }
}

In your components:

this name is current svg file name

  <svg-icon name="file_name" className="iconClass"></svg-icon>
  • name - SVG sprite symbol id value (svg file name)
  • className - svg class,arrays are supported(:className=['class1', 'class2'])

Customize configuration

See Configuration Reference.

Related Packages

rollup-plugin-svg-sprites

Rollup plugin for creating SVG sprites.

16,919
vite-plugin-svgs-icons

vite-plugin-svgs-icons svg-icon svg icon MultiColor修改

901 0
nuxt-svg-sprite-module

A quick and dirty way to inline svg sprites in your Nuxt app.

3,180 20
vue-svg-pan-zoom

Vue component for svg-pan-zoom

59,567
@jt-icons/icon-vue-components

Vue components of JT Icons collection.

2,961 1

Version History

Version Released Vue License
1.0.14 ~2.6.14 MIT
1.0.13 ~2.6.14 MIT
1.0.12 ~2.6.14 MIT
1.0.11 ~2.6.14 MIT
1.0.8 ~2.6.14 MIT