Skip to content

React quick start

  1. Import components:

    import {
    SvgImage, // Basically implements SVG sprites
    SvgIcon, // Basic SVG icon that uses SvgImage component internally
    } from "vite-awesome-svg-loader/react-integration";
  2. Import images:

    import imageSrc from "@/path/to/image.svg";
  3. Display images:

    export function MyComponent() {
    return (
    <div class="main">
    <SvgImage src={imageSrc} />
    <SvgIcon
    src={imageSrc}
    size="24px"
    color="red"
    colorTransition="0.3s ease-out"
    />
    </div>
    )
    }