https://github.com/ntnyq/vuepress-plugin-svg-icons
:fire: SVG sprite plugin for VuePress
https://github.com/ntnyq/vuepress-plugin-svg-icons
icon sprite svg vuepress vuepress-plugin vuepress2 vuepress2-plugin
Last synced: 6 months ago
JSON representation
:fire: SVG sprite plugin for VuePress
- Host: GitHub
- URL: https://github.com/ntnyq/vuepress-plugin-svg-icons
- Owner: ntnyq
- License: mit
- Created: 2019-02-27T16:41:49.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2024-10-28T03:00:56.000Z (11 months ago)
- Last Synced: 2024-10-28T06:41:41.096Z (11 months ago)
- Topics: icon, sprite, svg, vuepress, vuepress-plugin, vuepress2, vuepress2-plugin
- Language: TypeScript
- Homepage: https://vp-icon.ntnyq.com
- Size: 1.61 MB
- Stars: 19
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# vuepress-plugin-svg-icons
[](https://github.com/ntnyq/vuepress-plugin-svg-icons/actions)
[](https://www.npmjs.com/package/@goy/vuepress-plugin-svg-icons)
[](https://www.npmjs.com/package/@goy/vuepress-plugin-svg-icons)
[](https://github.com/ntnyq/vuepress-plugin-svg-icons/blob/main/LICENSE):heart: SVG sprite plugin for [VuePress](https://v2.vuepress.vuejs.org)
:book: [Live Demo and Docs](https://vp-icon.ntnyq.com)
## Note
:warning: The latest version since v5 only supports [VuePress v2](https://v2.vuepress.vuejs.org).
If you are looking for VuePress v1 support, please use [@goy/vuepress-plugin-svg-icons@4.3.0](https://www.npmjs.com/package/@goy/vuepress-plugin-svg-icons/v/4.3.0).
## Install
```bash
npm i @goy/vuepress-plugin-svg-icons -D
``````bash
yarn add @goy/vuepress-plugin-svg-icons -D
``````bash
pnpm add @goy/vuepress-plugin-svg-icons -D
```## Usage
```js
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:
```md
```
[Custom options detail](https://vp-icon.ntnyq.com/guide/#options)
## License
[MIT](./LICENSE) License © 2019-PRESENT [ntnyq](https://github.com/ntnyq)