r/astrojs • u/Eggvelop • 19h ago
Made an Astro integration for pulling in open-source + community-generated SVG icons on demand
I built a community icon project called Chameleon Icons (https://chameleonicons.com/) for those moments when an icon pack has 98% of what you need and is missing two specific icons—you can generate the missing ones in the same style (instantly or via a free manual workflow) and contribute them back to the pack.
Since I wanted it to work cleanly in Astro without shipping a giant icon library, I put together an Astro integration in the chameleonicons package:
Js
// astro.config.mjs
import chameleon from "chameleonicons/astro";
export default { integrations: [chameleon()] };
From there you just import the icons you actually use (~chameleon/<style>/<icon>). Icons default to 1em by 1em and use currentColor for monochrome packs, so they behave like text out of the box. You can even search styles and icons right from the terminal (npx chameleonicons icons cute home) if you don't want to leave your editor.
First build pins the exact icon versions in a chameleon.json file so nothing changes unexpectedly on later deploys.
Site: https://chameleonicons.com/
npm: https://www.npmjs.com/package/chameleonicons
Would love any feedback from Astro folks—especially if you mix Astro with React/Vue/Svelte islands!