Skip to content

takien/svg-icon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

SVG-Icon

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.

Example Usage

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>

Getting Started

  1. Include the SVG Icon Loader script in your HTML page using the provided CDN link.
  2. Use the <svg-icon> tag with the appropriate attributes (data-vendor and data-icon) to load your desired SVG icon.

Customization

Some icons support customization of it's color (fill and/or stroke)

Resources

License

This project is licensed under the MIT License - see the LICENSE file for details.


Need more info? ... coming soon