vite-plugin-svg-icons-ng weekly downloads statistics
By yangxu52 · npm · Vite plugins
Vite plugin for easily creating an SVG sprite and injecting it for use, with a brand-new version.
vite-plugin-svg-icons-ng has 6,106 recorded weekly downloads on npm, a decrease of 37.5% over the past 30 days, ranking #1093 of 2,391 tracked listings.
About vite-plugin-svg-icons-ng
vite-plugin-svg-icons-ng
A high-performance SVG icon plugin for Vite.
Automatically generates SVG sprites from files and configurable injects them at runtime, making icon usage simpler and more efficient.
For coding agents, install the companion skill:
npx skills add yangxu52/vite-plugin-svg-icons-ng # For global installation, add -g
Install
pnpm add -D vite-plugin-svg-icons-ng
Quick Start
import { defineConfig } from 'vite'
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons-ng'
export default defineConfig({
plugins: [
createSvgIconsPlugin({
iconDirs: ['src/icons'],
}),
],
})
At this point, the plugin can generate the SVG sprite and expose it through the standard Vite HTML flow.
Path resolution follows Vite: relative iconDirs are resolved from your Vite project root, while absolute paths are used as written. In monorepos, use an absolute path when the icon folder lives outside the current app root.
Default: htmlMode: 'inline', which injects the sprite into HTML. Use script for runtime mount + dev HMR, or none to disable automatic HTML injection.
If you use virtual:svg-icons/register, prefer htmlMode: 'none' to disable automatic HTML injection.
Use icons directly in templates, or encapsulate them in reusable components.
See Component Usage for framework examples.
<svg aria-hidden="true">
<use xlink:href="#icon-icon1"></use>
</svg>
Highlights
- File-based SVG icons with automatic sprite generation
- Configurable HTML generation:
script/inline/none - Cached compilation with HMR support
- Consistent output across dev, build, and SSR flows
- Safer icon sets with duplicate
symbolIddetection and optional build failure - Virtual modules for register, ids, and SSR sprite access
Virtual Modules
virtual:svg-icons/register: explicitly mount the sprite from a client entryvirtual:svg-icons/ids: read all generated symbol idsvirtual:svg-icons/sprite: read sprite markup for SSR template injection
Compatibility
Deprecated virtual module ids are still supported in the current release and are planned for removal in v2.0.0:
virtual:svg-icons-register->virtual:svg-icons/registervirtual:svg-icons-names->virtual:svg-icons/ids
Migration: update imports to the new slash-based virtual module ids before upgrading to v2.0.0.
Docs
Description from the npm listing.
- vite
- vite-plugin
- svg
- icon
- svg-icon
- svg-icons
- sprite
- spritemap
- spritesheet
- svg-sprite
- svg-sprites
- symbol
- svg-symbol
- svgo
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (122)Similar npm Vite plugins plugins
All 20 vite-plugin-svg-icons-ng alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/vite-plugin-svg-icons-ng. First seen Oct 16, 2026; last successful collection Oct 21, 2026. See the methodology.