JustinVoitel / svelte-hero-icons

Heroicons for SvelteKit (Project based on heroicons)
MIT License
119 stars 7 forks source link

[Question] import type IconSource #24

Closed holubond closed 2 years ago

holubond commented 2 years ago

Hi (sorry for a noob question),

I'm having issues importing the IconSource type, could you please lead me in the right direction?

I want to do this so I can use the type for having correctly typed props for a custom component.

Thank you!

JustinVoitel commented 2 years ago

Good catch! Types weren't exported correctly ^^

I've added them in version 4.1.3, so you can use it like this:

<script lang="ts">
   import { Icon, Home, type IconSource } from "svelte-hero-icons"
   export let icon: IconSource = Home
</script>

<Icon src={icon} />
holubond commented 2 years ago

@JustinVoitel That was blazingly fast, thanks!