Easiest way to use SVGs in an Astro or Svelte app
If you’ve been building websites or web applications for a while, you know how important SVGs are — they provide us with scalable graphics which we can use for icons and custom illustrations.
One of the most painful processes for using SVGs, is that you have to export the icons from Figma (or whatever your design tool is), put them into your project somehow, and then reference that icon.
Now that process can become so simple that you just have to specify an icon set and the icon name and poof, you get the icon you want.
It kinda looks like this:
Pretty cool yeah?
This uses the SVG utility from Splendid UI.
The additional benefit is you can also use this SVG utility to load custom SVGs you add to your project. Just like this:
Today I’m going to show you how this SVG utility work.
I’m quite sure you will love it if you use Svelte or Astro.
Enjoy, and let me know what you think!
Stay awesome,
Zell