Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

svelte-codicons

metonym3.8kMIT0.13.0TypeScript support: included

VS Code Codicons as Svelte components

svelte, svelte component, icon, svg, vs code, codicon

readme

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

# NPM
npm i -D svelte-codicons

# pnpm
pnpm i -D svelte-codicons

# Bun
bun add -D svelte-codicons

# Yarn
yarn add -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.

`svelte no-eval

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

## Using `svelte:component`

```svelte
<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" />

License

MIT

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

changelog

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

0.13.0 - 2024-08-25

  • Upgrade @vscode/codicons to v0.0.36 (net +22 icons)
  • Add exports map to package.json

0.12.0 - 2023-10-28

  • Upgrade @vscode/codicons to v0.0.35 (net +13 icons)

0.11.0 - 2023-05-02

  • Upgrade @vscode/codicons to v0.0.33 (net +5 icons)

0.10.1 - 2022-08-03

  • Republish v0.10.0

0.10.0 - 2022-08-03

  • Upgrade @vscode/codicons to v0.0.32 (net +9 icons)

0.9.0 - 2022-06-13

  • Upgrade @vscode/codicons to v0.0.31 (net +4 icons)

0.8.0 - 2022-05-10

  • Upgrade @vscode/codicons to v0.0.30 (net 0 icons, 2 icons modified)

0.7.1 - 2022-04-09

  • Upgrade svelvg to v0.10.1 so that TypeScript props correctly extend svg attributes

0.7.0 - 2022-03-12

  • Upgrade @vscode/codicons to v0.0.29 (net +7 icons)

0.6.0 - 2022-02-14

  • Upgrade @vscode/codicons to v0.0.28 (net +13 icons)

0.5.0 - 2021-12-14

  • Upgrade @vscode/codicons to v0.0.27 (net +2 icons)

0.4.0 - 2021-11-04

  • Upgrade @vscode/codicons to v0.0.26 (net +3 icons)

0.3.1 - 2021-10-14

  • Set type="module" in package.json

0.3.0 - 2021-10-04

  • Upgrade @vscode/codicons to v0.0.25 (net +7 icons)

0.2.0 - 2021-09-02

  • Upgrade @vscode/codicons to v0.0.22 (net +2 icons)

0.1.0 - 2021-08-31

  • Initial release