Skip to content

Latest commit

 

History

History
44 lines (31 loc) · 1.12 KB

README.md

File metadata and controls

44 lines (31 loc) · 1.12 KB

Description

heroicons for Svelte

See all available icons here: https://krowten.github.io/svelte-heroicons

Basic Usage

Note that this library currently only supports Svelte 3+ / SvelteKit.

First, install svelte-heroicons from npm:

npm install --save @krowten/svelte-heroicons

Сomponent can be used directly:

<script>
	import Icon from '@krowten/svelte-heroicons/Icon.svelte';
</script>

<div>
	<Icon name="beaker" class="h-5 w-5 text-blue-500" />
	<Icon name="beaker" class="h-5 w-5 text-blue-500" solid />
</div>

or each icon can be imported individually as a Svelte component:

<script>
	import { BeakerIcon } from '@krowten/svelte-heroicons';
	// or import BeakerIcon from '@krowten/svelte-heroicons/icons/BeakerIcon.svelte';
</script>

<div>
	<BeakerIcon class="h-5 w-5 text-blue-500" />
	<BeakerIcon class="h-5 w-5 text-blue-500" solid />
</div>

Both icon styles are preconfigured to be stylable by setting the color CSS property, either manually or using utility classes like text-gray-500 in a framework like Tailwind CSS.