Vanilla JS quick start
-
Import classes:
import {SvgImage, // Basically implements SVG spritesSvgIcon, // Basic SVG icon that uses SvgImage class internally} from "vite-awesome-svg-loader/vanilla-integration"; -
Import images:
import imageSrc from "@/path/to/image.svg"; -
Display images:
new SvgImage(imageSrc, "#my-container"); // Create an image and mount it to the element with "my-container" id.new SvgIcon(imageSrc, "#my-container") // Create an icon and mount it to the element with "my-container" id..setSize("24px") // Set 24px size.setColor("red") // Set red color.setColorTransition("0.3s ease-out"); // Set color transition