unplugin / unplugin-icons

🤹 Access thousands of icons as components on-demand universally.
https://www.npmjs.com/package/unplugin-icons
MIT License
3.99k stars 143 forks source link

Auto Import for SvelteKit (or VSCode import suggestion) #187

Closed SarcevicAntonio closed 2 years ago

SarcevicAntonio commented 2 years ago

Like I mentioned here https://github.com/antfu/unplugin-icons/issues/142#issuecomment-1054581854, Im trying to use auto-import with SvelteKit and wondered if it is supported at all.

Or if VSCode could somehow suggest imports of something like < IconMdiAccountBox/> I would be happy also very happy.

What can we do to get this working/supported?

userquin commented 2 years ago

what works is the auto import, we haven't a unplugin-vue-components for svelte, it works only with vue and react see https://github.com/antfu/unplugin-icons#auto-importing

userquin commented 2 years ago

uppps, wrong button, sorry

silasabbott commented 2 years ago

what works is the auto import

Are you saying we can manually set up auto-import in Svelte? Auto import is so convenient—I'd love to be able to use it in my Svelte projects

userquin commented 2 years ago

@silasabbott yes you can use auto import in suelte and sveltekit, check the examples folder in the auto import repo

antfu commented 2 years ago

This plugin only serves the icon as virtual modules. Auto-importing is out of the scope of this plugin. Maybe you can find a plugin for Svelte that work nicely with this plugin, or even write one your own.