Skip to content
S

svg2sprite

A very simple module to generate SVG sprites

by mrmlncFree

#1121in UI Libraries
0In stores

Description

svg2sprite is a small Node.js module that combines separate SVG icons into one SVG sprite. You create a collection, add each icon by name, a…

Highlights

  • Combines SVG icons into one sprite
  • Add, get, remove and clear icons
  • Inline mode for embedding in HTML
  • Prefix and suffix icon names
  • Strips empty tags and unwanted attributes

Ratings & Reviews

No ratings yet

Be the first to rate svg2sprite.

People also visit

S

svg-sprite

SVG sprites & stacks galore

UI Libraries
Launch
V

vue-svgicon

A tool to create svg icon components. (vue 2.x)

UI Libraries
Launch
A

astro-iconset

SVG icon integration for Astro

UI Libraries
Launch
S

@svgmoji/noto

The svgmoji sprites

UI Libraries
Launch
T

@twbs/fantasticon

Icon font generation tool

UI Libraries
Launch
T

theSVG

Curated collection of clean brand SVGs

UI Libraries
Launch

svg2sprite FAQ

What does svg2sprite do?

It builds a single SVG sprite from separate SVG icons, so a page can load one file that holds all of its icons.

How do I use it?

Create a collection, add each icon by name, then call compile to get the finished sprite. The README has code examples.

Can I embed the sprite directly in HTML?

Yes. The inline option prevents SVG namespace declarations and sets attributes so the sprite can be hidden inside the page.

Why was it written?

The README says existing solutions have many dependencies, and svg2sprite was written as a simpler alternative.

Can I clean up the icons?

Yes. Options strip empty tags, remove title and desc tags by default, and remove any attributes you list.

What are the best svg2sprite alternatives?

Popular alternatives to svg2sprite include svg-sprite, vue-svgicon and astro-iconset. See all svg2sprite alternatives

Developer Stuff

Badges