svgworm
Turn a folder of SVG files into type-safe, content-hashed SVG sprites, a manifest and TypeScript types. Zero client JavaScript, deterministic output, per-icon color handling.
pnpm add -D svgworm && pnpm add @svgworm/react # npm install -D svgworm && npm install @svgworm/react
pnpm svgworm init # config, predev/prebuild scripts, Icon component, first build (npx svgworm init)
pnpm svgworm # write the sprite, manifest and types
@svgworm/react is only for React and Next.js; an Astro, Vue or Svelte project needs just svgworm.
Pair it with @svgworm/react for a Server Component Icon where a wrong name is a type error. In an Astro, Vue or Svelte project, init writes a React-free Icon.astro, Icon.vue or Icon.svelte instead.
Docs
- Next.js setup
- Astro setup
- Vue and Nuxt setup
- Svelte and SvelteKit setup
- Vite setup, with the optional
svgworm/viteplugin - Sprites on a CDN: proxy them, or opt into
crossOrigin: "inject" - ⌨️ CLI reference
- Config:
svgworm.config.json, with a JSON Schema atsvgworm/schema.json - Comparison with SVGR, @neodx/svg and others
- For AI agents: llms.txt
Status: 0.x. Flags and the output contract can still change in a minor version before 1.0; see the changelog.
Related Packages
All ~3200 Remix Icons as importable SVG strings with framework wrapper component...
Flexible passkey authentication for Astro, SvelteKit, NextJS and other framework...
Scaffold React, Next.js, Vue, Nuxt, and SvelteKit projects with Feature-Sliced D...
Version History
| Version | Released | License |
|---|---|---|
| 0.5.0 | MIT | |
| 0.4.1 | MIT | |
| 0.4.0 | MIT | |
| 0.3.0 | MIT | |
| 0.2.1 | MIT | |
| 0.2.0 | MIT | |
| 0.1.0 | MIT |
Pre-releases (1)
| Version | Released | License |
|---|---|---|
| 0.0.0-stage |