Skip to content

ntnyq/vuepress-plugin-svg-icons

Repository files navigation

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 { defineUserConfig } from 'vuepress'
import { svgIconPlugin } from '@goy/vuepress-plugin-svg-icons'

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