Working With SVG Sprites
Added in version 2.30.
An SVG sprite stores several reusable icons in one ordinary SVG file. IconVectors opens the complete file as one document and shows its icons in a horizontal thumbnail strip below the canvas. Select a thumbnail to edit that icon. Switching icons does not save, discard changes or open another document.
Creating and Opening Sprites
Choose (Ctrl+Alt+N on Windows)
to create a sprite. Set its name,
default icon dimensions and initial number of empty icons. New icons are named
icon-1, icon-2 and so on, with the first ready for editing.
Use the normal Open command for an existing sprite SVG. In the Icon Explorer, a sprite tile previews up to four icons and shows the total icon count below the filename. Double-click the tile to open the sprite and see its full thumbnail strip. In an ordinary image viewer, a symbol-only sprite can look blank because its definitions become visible when referenced.
The menu appears while a sprite is open. Its commands and the strip toolbar manage the complete collection. Unsupported content remains preserved, with an explanation when an icon or operation is protected.
Sprite Organizations and Browser Usage
SVG sprites use several arrangements of standard SVG elements. IconVectors preserves the arrangements listed here when saving. New sprites and imported legacy sheets use symbols.
Symbol collections: each
symbolhas its own logical viewBox and can be displayed by ausereference.Definitions libraries: named
gor nestedsvgelements insidedefshold reusable icons. A group has no viewport of its own, so its dimensions must come from a trustworthy enclosing context. A nested SVG can supply its own viewBox. Unlabelled or ambiguous drawings are not automatically treated as libraries.Named-view atlases: each
viewselects a rectangle of the complete root drawing. It is a window onto artwork, not a container for that artwork. Independent editing requires a proven owner, such as a separate clipped nested SVG for that region. Overlapping or uncertain ownership can allow preview and export while keeping drawing protected.CSS target stacks: a URL fragment selects an icon through
:target. The supported static selection rules stay in the original file; they are not replaced with a proprietary selection mechanism. More complex selectors or active content retain protection.
Choose for the selected entry. Reusable definitions use a reference such as:
<svg viewBox="0 0 24 24">
<use href="icons.svg#search"/>
</svg>
Named views and target stacks use the SVG file’s fragment URL instead:
<img src="icons.svg#search" alt="Search">
Set the image’s width and height in HTML or CSS to suit your interface. The original sheet can have natural dimensions larger than the selected icon; the minimal copied snippet does not change that source sizing.
Opening a target stack without a fragment can correctly show nothing in a browser. Its selection stylesheet decides which icon is visible. A named view shows all artwork intersecting its selected rectangle; an overlap does not imply that the artwork belongs exclusively to that icon.
ViewBoxes, Position and Paint
An icon’s viewBox can have a nonzero or negative origin. Its logical dimensions are distinct from the width, height and position of an instance. Aspect-ratio settings can preserve proportions with unused space, crop the view or stretch its axes independently.
IconVectors qualifies these mappings together with strokes, gradients and ancestor clipping. A scaled stroke is not equivalent to multiplying its width by an arbitrary average. A user-space gradient must retain both its original percentage-length context and the coordinate mapping of the element it paints. Moving a gradient definition into an extracted icon must not change its colors. Unrepresentable mappings remain protected rather than being approximated silently.
For qualified mappings, clipping or curved dashed strokes, a stroke may become filled outline geometry in the private editing projection. Its outline then uses fill controls. Opening or switching icons alone does not rewrite the original file; a committed drawing change can persist the equivalent local geometry. Mapped authored CSS roles remain protected where converting them would lose their meaning, even when a faithful preview or separate export is available.
A dashed circle or ellipse can also require an equivalent path in a mapped projection. This keeps SVG’s dash start point and direction when an instance is reflected. Opening it alone still leaves the original source unchanged.
For a qualified atlas owner, the editing canvas uses that owner’s local coordinates. Saving retains its position in the atlas and the original named view. Export uses the named view’s complete drawing window, including its original world-coordinate viewBox; it does not export only a convenient subtree. Renaming the view updates the selected icon’s title. The underlying drawing container can have its own title and description; editing the icon preserves that separate metadata in the sprite.
Styles and Gradients
Two icons can share a gradient or CSS class even when they have different shapes. To change their appearance together, open , select the gradient or style and review the listed icons. Adjust a gradient stop or a style property, then choose Apply to All Icons. The change reaches the icons using that resource. Use Undo to reverse it.
For a change to one icon, edit its fill or stroke on the canvas. Some SVG styles depend on advanced selectors, inherited coordinates or external resources. When a shared style cannot be edited safely, the dialog explains the restriction.
Managing Icons
New Icon and Import insert before the selected icon. New Icon proposes the sprite’s default dimensions. Multi-file Import keeps its input order and is one Undo action; an unsupported file rejects the complete import.
Duplicate Icon gives the copy fresh identifiers. Duplicating a user keeps its intended shared references. Duplicating a definition makes a separate definition without redirecting the original users.
Rename Icon changes its display name. Change SVG ID and the ID field in change its public reference ID. Qualified references inside the sprite follow that change. References in other files must be updated separately.
Drag icons or use the Move and Sort commands to change their order where source context permits it. A move that would change inheritance or CSS appearance is protected.
Remove Icon refuses to remove a referenced definition and identifies its users. It does not silently delete or detach the consuming icons.
Saving, History and Export
Save and Save As write the complete sprite, including changes to icons that are no longer selected. There is one document dirty state and one chronological Undo/Redo history for drawing, shared edits and collection operations. Switching icons alone adds no history step.
In F3 (Source Code), SVG Sprite shows the complete sprite source. The SVG tab and the other code formats show the icon currently on the canvas. Select a different thumbnail to inspect another icon. When you open an ordinary SVG, the SVG Sprite tab disappears.
When you open a sprite, IconVectors applies Preferences → SVG Code → Decimals to supported coordinates throughout the working file, including icons you have yet to select. If any coordinates change, the sprite shows unsaved changes. SVG Sprite displays the cleaned source, and Save or Save As writes it to disk. Protected content and coordinates that cannot be rounded safely retain their original precision.
Use Export Icons for a standalone copy. A named view or target stack can require a different complete-file fragment frame from the local editing canvas.
Use Place & Trace Bitmap to center a traced bitmap in the selected editable icon. The File menu also exports the selected icon as minified SVG, XAML, a single bitmap, or multiple bitmaps. Bitmap sets preserve the icon’s proportions inside the square output sizes.
Use to export the current icon or all icons as standalone SVG or transparent PNG copies. Export does not mark the sprite as saved. Qualified SVG copies retain the icon’s logical viewBox, resolve the needed resources and follow SVG Code formatting preferences. Complete-parent Save retains the sprite structure rather than replacing it with one exported icon.
Creating a Sprite from Explorer Files
Select at least two SVG files in one Explorer folder and choose
or Create SVG Sprite…
above Batch Processing in the selection’s context menu. The dialog lists
the files and their pixel sizes.
Enter a new filename and click Create Sprite. IconVectors adds the
.svg extension if you omit it.
IconVectors saves the sprite in the current folder and opens it in the Editor. Each source file becomes one symbol with its own viewport. The source files stay in place, and the destination must be a new filename.
Importing a Legacy SVG Sheet
A legacy sprite places its icons side by side in one SVG image. A web page uses
CSS background-position and a fixed-size box to reveal one icon at a time.
The sheet itself usually carries no tile size. When you open an SVG with whole
canvas dimensions and the longer side is a whole-number multiple of the shorter
side, IconVectors suggests splitting it into square tiles. For example, a
96 × 24 SVG starts with four
24 × 24 tiles. Choose Open as Legacy Sprite to use the grid or Open as
Icon to edit the whole image.
Choose Don’t ask again to turn off the suggestion. Turn it back on under with Suggest opening possible legacy SVG sprites. For other layouts, use in Editor or Explorer. Enter the width and height of a tile as positive whole numbers in SVG units. The tiles must fill a regular grid starting at the sheet’s viewBox origin. Icons appear from left to right, then top to bottom. When the import succeeds, the sprite opens in the Editor.
Save the imported document to create a new sprite made of SVG <symbol>
elements. Keep the original sheet for any pages that use background positioning.
To use the new sprite in a page, reference each icon by its ID with <use>.
Before the first edit or save, the SVG Sprite tab shows the original sheet.
VS Code, Recovery and Large Sprites
Opening an SVG file from VS Code still edits one complete sprite document.
A reference with a supported exact #icon-id selects that entry separately
from the file path. Saving an inline sprite updates its complete owned SVG block,
while keeping the surrounding project text and the existing conflict checks.
An arbitrary svgView(...) expression is not an exact icon ID.
Recovery records contain the complete pending sprite, including changes to icons that are no longer selected and shared resources. Recovery writing stages the new UTF-8 record before replacing the previous one. A failed write or conflicting destination change must leave the previous valid record intact.
Icons and thumbnails are prepared on demand. Drawing Undo/Redo can retain an inactive workspace, so it is not discarded merely because another icon is selected. Large-sprite loading depends on the number and complexity of elements; parser and resource limits still apply. An entry-count benchmark is not a promise that arbitrary artwork has the same loading cost.