@svelte-put/inline-svg
TypeScript icon, indicating that this package has built-in type declarations

3.0.0 • Public • Published

@svelte-put/inline-svg

npm.badge bundlephobia.badge docs.badge

Svelte action use:inlineSvg for inlining dynamic SVGs (fetched from network)

svelte-put

This package is part of the @svelte-put family. For contributing guideline and more, refer to its readme.

Usage & Documentation

See the dedicated documentation page here.

Quick Start

<script>
  import { inlineSvg } from '@svelte-put/inline-svg';
</script>

<svg use:inlineSvg={'https://example.com/icon.svg'}></svg>

To inline static SVGs during build time, use @svelte-put/preprocess-inline-svg, which is also conveniently re-exported from this package.

// svelte.config.js
import { inlineSvg } from '@svelte-put/inline-svg/preprocess';

/** @type {import('@sveltejs/kit').Config} */
const config = {
  preprocess: [inlineSvg()],
};
export default config;

See documentation for preprocessor at @svelte-put/preprocess-inline-svg.

Changelog

buy vnphanquang a coffee

Package Sidebar

Install

npm i @svelte-put/inline-svg

Weekly Downloads

111

Version

3.0.0

License

MIT

Unpacked Size

15.1 kB

Total Files

9

Last publish

Collaborators

  • vnphanquang