README
svelte-codicons
VS Code Codicons as Svelte components.
This library uses svelvg to convert SVG files from the @vscode/codicons
NPM package into Svelte components.
Try it in the Svelte REPL.
Installation
Yarn
yarn add -D svelte-codicons
NPM
npm i -D svelte-codicons
pnpm
pnpm i -D svelte-codicons
Usage
Basic
<script>
import { Add, Calendar, Edit } from "svelte-codicons";
</script>
<Add />
<Calendar />
<Edit />
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 "svelte-codicons/lib/Add.svelte";
</script>
svelte:component
Using <script>
import * as icons from "svelte-codicons";
</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
vscode-codicons
is licensed as CC-BY-4.0.