Skip to content

Latest commit

 

History

History
63 lines (40 loc) · 1.84 KB

README.md

File metadata and controls

63 lines (40 loc) · 1.84 KB

vuepress-plugin-svg-icons

CI NPM VERSION NPM DOWNLOADS LICENSE

❤️ SVG sprite plugin for VuePress

📖 Live Demo and Docs

Note

⚠️ The latest version since v5 only supports VuePress v2.

If you are looking for VuePress v1 support, please use @goy/vuepress-plugin-svg-icons@4.3.0.

Install

npm i @goy/vuepress-plugin-svg-icons -D
yarn add @goy/vuepress-plugin-svg-icons -D
pnpm add @goy/vuepress-plugin-svg-icons -D

Usage

import { svgIconPlugin } from '@goy/vuepress-plugin-svg-icons'
import { defineUserConfig } from 'vuepress'

export default defineUserConfig({
  plugins: [svgIconPlugin()],
})

Create a folder named icons in your document sourceDir and put all your svg files in it.

All icons will be loaded automatic.

The plugin provides a global component named VpIcon.

Just enjoy it! 😊

<vp-icon name="github" />

<vp-icon color="#3eaf7c" name="vue" />

<vp-icon color="#3eaf7c" name="vue" size="4em"/>

Custom options detail

License

MIT License © 2019-PRESENT ntnyq