heroicons + sidekickicons

Search icons

Heroicons for Svelte

Heroicons has no official Svelte package. @sidekickicons/svelte has all 316 Heroicons plus 78 Sidekickicons as Svelte 5 components. It needs Svelte 5.19 or later.

Browse icons with Svelte code

Install

npm install @sidekickicons/svelte

Usage

Import icons from the directory of the style you want. Heroicons and Sidekickicons come from the same package, so you can mix them freely. Only the icons you import end up in your bundle.

<script>
  import { ChartBarIcon, CrownIcon } from "@sidekickicons/svelte/24/outline";
</script>

<ChartBarIcon class="text-slate-500" />
<CrownIcon class="size-8 text-indigo-600" />
StyleImport fromDesignDefault size
Outline24/outline24×24, 1.5 px stroke24 px
Solid24/solid24×24, solid fill24 px
Mini20/solid20×20, solid fill20 px
Micro16/solid16×16, solid fill16 px

Component names are the icon name in PascalCase followed by Icon: crown is CrownIcon.

Size and color

  • Icons have a default size of 24, 20 or 16 px, depending on the style. Any size class you pass, like size-8 in Tailwind, overrides it.
  • Icons use currentColor, so they take the text color around them, or a color class like text-indigo-600.
  • The class prop works like any Svelte class attribute, so it also takes arrays and objects.

Importing a single icon

You can also import a single icon file directly, with full types:

import CrownIcon from "@sidekickicons/svelte/24/outline/CrownIcon.svelte";

Accessibility

Icons are hidden from screen readers, so give the button or link around an icon a label:

<button aria-label="Upgrade">
  <CrownIcon class="text-indigo-600" />
</button>

Icons Heroicons doesn't have

The package also has 78 Sidekickicons in the same style, like these. See them all on Icons missing from Heroicons .