SVG Icon Loader is a lightweight JavaScript library that allows you to easily embed SVG icons on your web page without the need to paste long SVG code. With just a small snippet of code, you can load SVG icons effortlessly.
To load a Dashicon named admin-home
, simply paste the following code into your web page:
<svg-icon data-vendor="WordPress/dashicons" data-icon="admin-home"></svg-icon>
Make sure to include the SVG Icon Loader JavaScript file in your HTML page before using the snippet. You can do so by adding the following line in the <head>
section of your HTML:
<script type="module" src="https://cdn.jsdelivr.net/gh/takien/svg-icon/src/svg-icon.min.js"></script>
- Include the SVG Icon Loader script in your HTML page using the provided CDN link.
- Use the
<svg-icon>
tag with the appropriate attributes (data-vendor
anddata-icon
) to load your desired SVG icon.
Some icons support customization of it's color (fill and/or stroke)
This project is licensed under the MIT License - see the LICENSE file for details.
Need more info? ... coming soon