One Icon or the Whole SVG Sprite? What Happens When You Press Enter?
DEV Community

One Icon or the Whole SVG Sprite? What Happens When You Press Enter?

Type export and press Enter. Do you get search.svg, a standalone icon, or icons.svg, the shared sprite?

In one version of our prototype, the highlighted command said Export in both cases. In our prototype, pressing Enter runs the highlighted command. We tested the same export search with and without a symbol selected to see whether the command label tells you which file you'll get.

Same search, two selection states

Our test sprite contained three symbols: search, filter, and settings.

In Chromium, we typed export with Search selected, then repeated the test with no symbol selected. Each time, we checked the active row before pressing Enter, then opened the downloaded SVG and checked its IDs.

Selection Active command before Enter Download IDs in the SVG
Search Export search.svg search
None Export icons.svg search, filter, settings
Search Export selected symbol search.svg search
None Export entire sprite icons.svg search, filter, settings

The standalone file had id="search" on its root <svg>. The sprite had three <symbol> elements.

Put the export scope in the active row

With Search selected, the second palette listed Export selected symbol first and Export entire sprite second. Enter downloaded search.svg. One press of Down Arrow before Enter downloaded icons.svg with the selection still in place.

With no selection, only Export entire sprite was available. The prototype still used selection and result order to pick the default. The more specific labels made the effect of Enter visible before the download.

If you're testing a similar palette, check both selection states and inspect the file each active row writes.

We built the palette for this experiment. For the actual sprite workflow in IconVectors 2.30, see how to edit, reorder, and export one icon from an SVG sprite.

Read on DEV Community ↗ ← Back to News

Comments

No comments yet. Start the discussion.