vite-svg-sprite-wrapper weekly downloads statistics
By vshepel · npm · Vite plugins
Creating one sprite file on the fly
vite-svg-sprite-wrapper has 7,175 recorded weekly downloads on npm, a decrease of 38.2% over the past 30 days, ranking #1047 of 2,322 tracked listings.
About vite-svg-sprite-wrapper
vite-svg-sprite-wrapper
<p> <a href="https://npmjs.com/package/vite-svg-sprite-wrapper"><img src="https://img.shields.io/npm/v/vite-svg-sprite-wrapper.svg" alt="npm package"></a> </p>svg-sprite wrapper for Vite
Install
npm i vite-svg-sprite-wrapper -D
Usage
Add it to your plugins in vite.config.ts
import { defineConfig } from 'vite'
import ViteSvgSpriteWrapper from 'vite-svg-sprite-wrapper';
export default defineConfig({
plugins: [
ViteSvgSpriteWrapper({
/**
* Input directory
*
* @default 'src/assets/images/svg/*.svg'
*/
icons?: string
/**
* Output directory
*
* @default 'src/public/images'
*/
outputDir?: string
/**
* sprite-svg {@link https://github.com/svg-sprite/svg-sprite/blob/main/docs/configuration.md#sprite-svg-options|options}
*/
sprite?: SVGSpriter.Config
/**
* Defines if a type should be generated
* @default false
*/
generateType?: boolean
/**
* Name of the type to be used when generateType is set to true
* @default 'SvgIcons'
*/
typeName?: string
/**
* File name of the generated type file
* @default 'svg-icons'
*/
typeFileName?: string
/**
* Name of the output directory for generated type file
* @default '{@link icons} directory'
*/
typeOutputDir?: string
}),
],
})
Now, any changes to the .svg files in the icons folder will generate a sprite.svg in the outputDir folder.
So you can use the icons somehow (Example):
<svg class="icon" aria-hidden="true">
<use xlink:href="/images/sprite.svg#star"></use>
</svg>
Example of React Component:
Config:
ViteSvgSpriteWrapper({
outputDir: 'public',
generateType: true,
typeName: 'IIcon',
typeFileName: 'Icon',
typeOutputDir: './src/type',
})
Component:
import type { IIcon } from './src/type/Icon'
import sprite from '/sprite.svg'
interface Props {
icon: IIcon
}
function Icon({ icon }: Props) {
return (
<svg className="icon" aria-hidden="true">
<use xlinkHref={`${sprite}#${icon}`}></use>
</svg>
)
}
export default Icon
MIT License © 2025 Volodymyr Shepel
Description from the npm listing.
- vite
- vite-plugin
- svg
- svg-sprite
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-svg-sprite-wrapper 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-svg-sprite-wrapper. First seen Oct 16, 2026; last successful collection Oct 20, 2026. See the methodology.