@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.
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.
No install:
<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:
.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;
}Every drawing paints with currentColor. Inlined into the page, it takes the
text colour around it:
<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.
npm install @devigner-ui/icons-svg<svg width="24" height="24"><use href="/sprite/outline.svg#ShoppingCart" /></svg>Two things to know first:
<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.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.