Grommet SVG icons as Svelte components.
Try it in the Svelte REPL.
# Yarn
yarn add -D svelte-grommet-icons
# npm
npm i -D svelte-grommet-icons
# pnpm
pnpm i -D svelte-grommet-icons
<script>
import { Analytics, Camera, DocumentImage } from "svelte-grommet-icons";
</script>
<Analytics />
<Camera />
<DocumentImage />
Refer to ICON_INDEX.md for a list of supported icons.
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 "svelte-grommet-icons/lib/Add.svelte";
</script>
svelte:component
<script>
import * as icons from "svelte-grommet-icons";
</script>
{#each Object.entries(icons) as [icon, component]}
<div>
<svelte:component this={component} />
{icon}
</div>
{/each}
Svelte version 3.31 or greater is required to use this library with TypeScript.