SVG and sprites

@devigner-ui/icons-svg: every drawing as a plain SVG file, plus one sprite per style. For vanilla pages, CDNs, CSS backgrounds, server templates, email builders and design tools: anywhere there is no component framework.

Paths

Output
svg/<style>/<Name>.svg      one drawing
sprite/<style>.svg          every icon in that style

<style> is outline, twotone, bold, bulk or broken. <Name> is the icon's name as the icon set shows it, capitals included: ShoppingCart, ArrowLeft.

From a CDN

No install:

HTML
<img
  src="https://cdn.jsdelivr.net/npm/@devigner-ui/icons-svg@3.5.0/svg/outline/ShoppingCart.svg"
  alt=""
  width="24"
  height="24"
/>

Keep the version in the URL. An unversioned link follows every release, and a rename then breaks it in the next major.

As a CSS background, where the icon should follow the box rather than the text:

CSS
.icon-cart {
  width: 24px;
  height: 24px;
  background: url("https://cdn.jsdelivr.net/npm/@devigner-ui/icons-svg@3.5.0/svg/outline/ShoppingCart.svg")
    center / contain no-repeat;
}

Colour

Every drawing paints with currentColor. Inlined into the page, it takes the text colour around it:

HTML
<span style="color: rebeccapurple">
  <!-- the contents of svg/outline/ShoppingCart.svg -->
</span>

Loaded through <img> or a CSS background, an SVG cannot see the page's colour; that is a browser rule. Inline the markup, or bake a colour into your own copy of the file. Stroke width is 1.5 throughout.

Sprites

Terminal
npm install @devigner-ui/icons-svg
HTML
<svg width="24" height="24"><use href="/sprite/outline.svg#ShoppingCart" /></svg>

Two things to know first:

  • A sprite is the whole set, about 1.4 MB per style. Loading it for nine icons costs more than nine <img> tags.
  • <use> with an external file is same-origin only. Browsers block a sprite from another origin, so serve it from your own site, not a CDN.

Not the right fit?

For React, Vue, Svelte or React Native, the component packages are smaller to ship and take props for style and stroke width; see Frameworks in the sidebar. For a one-off icon, copy it from the site.

Documentation

Browse all 12,480 icons