Skip to content
PluginStats

@svg-jar/plugin weekly downloads statistics

By svg-jar · npm · Vite plugins

An unplugin for importing SVGs as components with sprite sheet support

View on npm Fresh · Oct 28, 2026

@svg-jar/plugin has 2,204 recorded weekly downloads on npm, ranking #1277 of 2,644 tracked listings.

Weekly downloads
2,204
Official API · Oct 26, 2026
7-day growth
—
Insufficient history
30-day growth
—
Insufficient history
90-day growth
—
Insufficient history
Rank
#1277
Among tracked npm listings

About @svg-jar/plugin

<div align="center"> <picture> <img alt="SvgJar" src="https://raw.githubusercontent.com/svg-jar/plugin/main/logo-banner.svg"> </picture>

@svg-jar/plugin

npm version CI License

</div>

An unplugin for importing SVGs as components. Supports sprite sheets, inline SVGs, and raw file exports across Vite, Rollup, and Rolldown (including tsdown).

Install

pnpm add -D @svg-jar/plugin

Setup

Vite
// vite.config.ts
import svgJar from '@svg-jar/plugin/vite';

export default {
  plugins: [svgJar({ target: 'ember' })],
};
Rollup
// rollup.config.ts
import svgJar from '@svg-jar/plugin/rollup';

export default {
  plugins: [svgJar({ target: 'ember' })],
};
Rolldown
// rolldown.config.ts
import svgJar from '@svg-jar/plugin/rolldown';

export default {
  plugins: [svgJar({ target: 'ember' })],
};
tsdown

tsdown is built on Rolldown, so it uses the Rolldown entry point. Declaration files (dts: true) get correctly typed exports for each SVG import.

// tsdown.config.ts
import { defineConfig } from 'tsdown';
import svgJar from '@svg-jar/plugin/rolldown';

export default defineConfig({
  entry: ['src/index.ts'],
  dts: true,
  plugins: [svgJar({ target: 'dom', base: '/vendor/icons/' })],
});

[!IMPORTANT] Sprite sheets are an application-level optimization — their benefits (app-wide symbol dedupe, per-symbol tree-shaking, a single sheet on a known origin) only exist when one build owns the whole module graph. A package built with tsdown emits sprite and ?file assets into its own dist/assets with baked URLs that a consuming bundler will not copy or rewrite.

Use sprite or ?file output from tsdown only for internal packages where the consuming app controls the deploy origin: set the base option to a fixed public path, and have the app copy the package's dist/assets there as part of its build (see test-projects/tsdown/internal-package). For publicly distributed libraries, ship raw SVG files (and let the consuming app run svg-jar itself) or export inline components (?unsafe-inline), which need no asset serving.

Usage

Sprite mode (default)

SVGs are collected into a sprite sheet and rendered via <use href>. The sprite file is emitted with a content-hashed filename for cache busting.

import Arrow from './icons/arrow.svg';
Named sprites

Group SVGs into separate sprite sheets with the ?sprite=name query:

import Circle from './icons/circle.svg?sprite=shapes';

This creates a separate shapes-<hash>.svg sprite file containing only the icons assigned to it.

Inline mode

Embed the full SVG markup directly in the component. No sprite sheet, no external request.

import Square from './icons/square.svg?unsafe-inline';

[!CAUTION] Inline SVGs are embedded in your JavaScript bundle, increasing parse time and preventing separate caching. Sprite mode (the default) is more efficient for most use cases. See What's unsafe about inline SVGs?

File mode

Export the SVG as a raw asset URL, like any other static file:

import logoUrl from './icons/logo.svg?file';

const img = document.createElement('img');
img.src = logoUrl;

Options

svgJar({
  // Framework target for component generation.
  // Default: 'dom'
  target: 'dom' | 'ember' | 'react' | 'preact' | 'vue' | 'solid' | 'web-component',

  // SVGO configuration. See "SVGO optimization" below.
  // true (default): use the baseline config
  // false: disable optimization entirely
  // object: custom SVGO config, used in place of the baseline
  svgo: true,

  // Default sprite name for bare SVG imports.
  // Default: 'sprite'
  defaultSprite: 'sprite',

  // Replace non-none fill/stroke with currentColor globally.
  // Default: false
  currentColor: false,

  // Attributes copied from the root <svg> of each source file to the <svg>
  // that the runtime renders. See "Root attributes" below.
  // Default: the list below. A list given here replaces the default list.
  rootAttributes: [
    'fill',
    'fill-opacity',
    'fill-rule',
    'stroke',
    'stroke-width',
    'stroke-linecap',
    'stroke-linejoin',
    'stroke-miterlimit',
    'stroke-dasharray',
    'stroke-dashoffset',
    'stroke-opacity',
    'clip-rule',
    'opacity',
    'color',
  ],

  // Sprite sheets to inline into the HTML document rather than emit as
  // external files. See "Embedded sprites" below.
  // true: embed all sprites  |  string[]: embed named sprites  |  false (default): external files
  embedded: false,

  // Base public path prepended to emitted asset URLs (sprite sheets and
  // ?file assets). Defaults to Vite's resolved `base` in Vite, '/' elsewhere.
  // Set this when the build output is served from a known non-root location,
  // e.g. an internal package whose dist/assets the consuming app copies to a
  // fixed public path. A trailing slash is added if missing.
  base: '/vendor/icons/',
});
Per-SVG modifiers

These can be combined with any import mode:

QueryEffect
?current-colorReplace fill/stroke with currentColor (opt-in per SVG)
?skip-current-colorPreserve original colors (opt-out when global option is true)

Description from the npm listing.

  • svg
  • svg-jar
  • icons
  • sprite
  • sprite-sheet
  • symbol
  • components
  • unplugin
  • vite
  • vite-plugin
  • rollup
  • rollup-plugin
  • rolldown
  • esbuild
  • webpack
  • rspack
  • react
  • preact
  • vue
  • solid

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

@svg-jar/plugin weekly downloads on npm, last 90 days: 2,204 weekly downloads as of Oct 26, 2026.@svg-jar/pluginWeekly downloads on npm · Last 90 days2,204downloads / week1.9K2K2.1K2.2K2.3K2.4K2.5KJul 28Aug 12Aug 27Sep 11Sep 26Oct 11Oct 26downloads / weekOct 26, 2026 – Oct 26, 2026 · 1 observations · Updated Oct 26, 2026pluginstats.com
@svg-jar/plugin weekly downloads on npm, last 90 days: 2,204 weekly downloads as of Oct 26, 2026.

7/30/90-day growth

@svg-jar/plugin weekly downloads growth on npm: 7-day growth unavailable, 30-day growth unavailable, 90-day growth unavailable.@svg-jar/pluginWeekly downloads growth on npm2,204downloads / week now7-day growthinsufficient historyInsufficient history30-day growthinsufficient historyInsufficient history90-day growthinsufficient historyInsufficient historyGrowth vs. nearest observation to each baseline date · Updated Oct 26, 2026pluginstats.com
@svg-jar/plugin weekly downloads growth on npm: 7-day growth unavailable, 30-day growth unavailable, 90-day growth unavailable.

Ranking history

@svg-jar/plugin npm ranking history: currently #1277 (by weekly downloads).@svg-jar/pluginnpm ranking · by weekly downloads · Last 90 days#1277current rank#1275#1276#1277#1278#1279Jul 30Aug 14Aug 29Sep 13Sep 28Oct 13Oct 28rankOct 28, 2026 – Oct 28, 2026 · 1 observations · Updated Oct 26, 2026pluginstats.com
@svg-jar/plugin npm ranking history: currently #1277 (by weekly downloads).

Listing placement

All npm2,642 listings · 133 pages · 1,323 shown · page 74, #6 (overall #1,466)
All npm: every listing in weekly downloads order

Listing placement

Vite plugins275 listings · 14 pages · page 14, #1 (overall #261)
Vite plugins: every listing in weekly downloads order

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 (1)
Recent weekly downloads observations for @svg-jar/plugin
Date (UTC)Weekly downloadsChange vs. previous
2,204—

Similar npm Vite plugins plugins

All 20 @svg-jar/plugin alternatives

Data 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/@svg-jar/plugin. First seen Oct 28, 2026; last successful collection Oct 28, 2026. See the methodology.