1.6.0 • Published 3 months ago

svelte-svg-import v1.6.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

svelte-svg-import

Use SVG files as Svelte component

Usage

Add Vite plugin vite.config.js:

import svelteSvgImport from 'svelte-svg-import';

export default defineConfig({
  plugins: [
    svelteSvgImport(),
    sveltekit(),
  ],
});

Import SVG file with ?svelte suffix to use it as component:

<script>
  import Image from 'image.svg?svelte';
</script>

<Image width="20" height="20" />

For Typescript support add types for .svg to your project (e.g. to svg.d.ts).

1.6.0

3 months ago

1.5.0

9 months ago

1.4.0

9 months ago

1.3.0

10 months ago

1.2.0

10 months ago

1.1.0

10 months ago

1.0.1

11 months ago

1.0.0

11 months ago