Skip to content

Latest commit

 

History

History

template

npm-name

NPM

lib-name SVG icons as Svelte components.


Installation

# Yarn
yarn add -D npm-name

# NPM
npm i -D npm-name

# pnpm
pnpm i -D npm-name

Usage

Basic

<script>
  import { Analytics, Camera, DocumentImage } from "npm-name";
</script>

<Analytics />
<Camera />
<DocumentImage />

Refer to ICON_INDEX.md for a list of supported icons.

Direct import

Use the direct import for faster compiling during development.

Note: even if using base imports, unused imports are still tree shakeable by application bundlers like Rollup or webpack.

<script>
  import Add from "npm-name/lib/Add.svelte";
</script>

Using svelte:component

<script>
  import * as icons from "npm-name";
</script>

{#each Object.entries(icons) as [icon, component]}
  <div>
    <svelte:component this={component} />
    {icon}
  </div>
{/each}

TypeScript

Svelte version 3.31 or greater is required to use this library with TypeScript.

License

MIT