vue-icon-gallery
Version:
Vite plugin for Vue 3 that opens a local gallery to preview your SVG icons before using them in templates. Instantly browse, search, and view your icons directly from your dev server β no more guessing by file name.
118 lines (76 loc) β’ 2.74 kB
Markdown
# π¨ vue-icon-gallery
**A Vite plugin for Vue 3 that opens a local gallery to preview your SVG icons before using them in templates.**
Perfect for projects where icon names arenβt enough β see your icons instantly, browse, search, and copy names without leaving your dev environment.
## β¨ Features
- πΌοΈ **SVG preview gallery** β visualize all your icons directly in the browser
- π **Auto-updates** β new icons appear instantly, no rebuild required
- βοΈ **Configurable paths & port** β preview multiple icon folders
- π« **No production impact** β runs only during development
- π¨ **Live color testing** β try different `fill` / `stroke` colors right in the gallery
## π§© Preview

## π¦ Installation
```bash
npm i -D vue-icon-gallery
```
## βοΈ Usage (vite.config.ts)
```typescript
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { vueIconGallery } from 'vue-icon-gallery'
export default defineConfig({
plugins: [
vue(),
vueIconGallery({
iconsPath: ['src/components/icons', 'src/assets/svg'], // folders with your SVG files
port: 3002, // default: 3002
open: true // default: true (open gallery in browser automatically)
})
]
})
```
Then start your dev server as usual:
```bash
npm run dev
```
The plugin will launch a local **SVG gallery server** and print its URL to the console.
## π§ How it works
1. Scans specified folders for `.vue` files with `<svg>` tags.
2. Serves them via a lightweight local server.
3. Opens a visual gallery page for previewing and copying icon names.
## π‘ Why use this plugin?
When you store SVGs as `<template>` components or inline assets, itβs often hard to remember what each one looks like.
This plugin solves that β you can **see every icon visually before inserting it into code**.
## π§° Requirements
- Vue 3
- Vite 5+
- Node.js 20+
## π Roadmap
- [ ] Support for React / Svelte projects
- [ ] Icon metadata and categorization
- [ ] Light theme for gallery
- [ ] Inline icon copy option
## π Example use cases
- Component libraries with large icon sets
- Design systems using SVG templates
- Teams maintaining internal icon packs
## π§Ύ License
MIT Β© [Egor Maksimov](https://github.com/MaksimovEgor)
## π Links
- π¦ [NPM Package](https://www.npmjs.com/package/vue-icon-gallery)
- π» [GitHub Repository](https://github.com/MaksimovEgor/vue-icon-gallery)
- π If you like it β give it a β on GitHub!
### π§ Keywords
`vite plugin svg` Β· `vue svg icons` Β· `svg gallery` Β· `vite icon preview` Β· `vue3` Β· `frontend tools`