svelte-stacks-icons

Stack Overflow Stacks SVG icons as Svelte components

Usage no npm install needed!

<script type="module">
  import svelteStacksIcons from 'https://cdn.skypack.dev/svelte-stacks-icons';
</script>

README

svelte-stacks-icons

NPM

Stack Overflow Stacks SVG icons as Svelte components.

Try it in the Svelte REPL.


Installation

Yarn

yarn add -D svelte-stacks-icons

NPM

npm i -D svelte-stacks-icons

pnpm

pnpm i -D svelte-stacks-icons

Usage

Basic

<script>
  import { Alert, Calendar, Eye } from "svelte-stacks-icons";
</script>

<Alert />
<Calendar />
<Eye />

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 School from "svelte-stacks-icons/lib/School.svelte";
</script>

Using svelte:component

<script>
  import * as icons from "svelte-stacks-icons";
</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.

Changelog

License

MIT