@goy/vuepress-plugin-svg-icons
v5.6.1
Published
SVG sprite icon plugin for VuePress
Downloads
332
Maintainers
Readme
vuepress-plugin-svg-icons
:heart: SVG sprite plugin for VuePress
:book: Live Demo and Docs
Note
:warning: The latest version since v5 only supports VuePress v2.
If you are looking for VuePress v1 support, please use @goy/[email protected].
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! :blush:
<vp-icon name="github" />
<vp-icon color="#3eaf7c" name="vue" />
<vp-icon color="#3eaf7c" name="vue" size="4em"/>