❤️ SVG sprite plugin for VuePress
If you are looking for VuePress v1 support, please use @goy/vuepress-plugin-svg-icons@4.3.0.
npm i @goy/vuepress-plugin-svg-icons -D
yarn add @goy/vuepress-plugin-svg-icons -D
pnpm add @goy/vuepress-plugin-svg-icons -D
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"/>