0.12.0 • Published 7 months ago

svelte-codicons v0.12.0

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

svelte-codicons

NPM

VS Code Codicons as Svelte components.

This zero-dependency library uses svelvg to convert SVG files from the @vscode/codicons 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.

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

Using svelte:component

<script>
  import * as icons from "svelte-codicons";
</script>

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

Custom size

$$restProps are forwarded to the svg element.

Use the width and height attributes to customize the icon size. The default is 16px.

<Add width={36} height={36} />

Custom color

Use the fill attribute to specify a custom color.

<Add fill="red" />

Changelog

License

MIT

vscode-codicons is licensed as CC-BY-4.0.

0.12.0

7 months ago

0.11.0

1 year ago

0.10.0

2 years ago

0.10.1

2 years ago

0.9.0

2 years ago

0.8.0

2 years ago

0.7.1

2 years ago

0.7.0

2 years ago

0.5.0

2 years ago

0.6.0

2 years ago

0.4.0

3 years ago

0.3.1

3 years ago

0.3.0

3 years ago

0.2.0

3 years ago

0.1.0

3 years ago