icon icon indicating copy to clipboard operation
icon copied to clipboard

Feature request: Custom icon from file

Open HigherOrderLogic opened this issue 3 years ago • 15 comments

I would like to be able to make custom icon from file like unplugin-icons.

HigherOrderLogic avatar Oct 10 '22 16:10 HigherOrderLogic

Have you try to use also unplugin-icons with this module?

atinux avatar Oct 11 '22 12:10 atinux

I was planning to create a feature request that is similar to @HigherOrderLogic issue, as the need to wrap custom icons in vue components is not that intuitive. I think if we could change it to work as nuxt-icons module, which is the most intuitive way and the most similar to nuxt terminology in my opinion, it would be more enjoyable to use.

AbdallahAlhaddad avatar Oct 21 '22 11:10 AbdallahAlhaddad

I forgot about nuxt-icons which is a great module. I also like the idea a lot, I usually create a Vue file with the SVG inside the <template> then I directly use the component name in <Icon name="MyCustomSVGIcon" />.

One thing which is bothering my here is about this import: https://github.com/gitFoxCode/nuxt-icons/blob/main/src/runtime/components/nuxt-icon.vue#L7

I am afraid that it might be quite big if it includes a lot of svg icons and is not leveraging tree-shaking.

atinux avatar Oct 21 '22 20:10 atinux

This issue could be a solution, with this, I would love to find a way to merge those two packages together. WDYT @gitFoxCode ?

atinux avatar Oct 21 '22 20:10 atinux

+1 This feature will make this the go-to module for icons

MuhammadM1998 avatar Oct 22 '22 00:10 MuhammadM1998

+1 This feature will make this the go-to module for icons

+1 As well, being able to to fetch icons on demand from the iconify framework and using custom local icons (assets/icons for example), would be essentially the complete and go-to package.

velvetcode206 avatar Nov 07 '22 20:11 velvetcode206

+1 As well, being able to to fetch icons on demand from the iconify framework and using custom local icons (assets/icons for example), would be essentially the complete and go-to package.

excatly. You can have a better DX by using unplugin icons with the module but it requires some config. Having these features out of the box would make our lifes better

MuhammadM1998 avatar Nov 09 '22 12:11 MuhammadM1998

Planned but will be after 3.0 release

atinux avatar Nov 09 '22 12:11 atinux

Planned but will be after 3.0 release

This is great. Thanks for the amazing work from you and the whole team

MuhammadM1998 avatar Nov 09 '22 12:11 MuhammadM1998

Thank you for trusting us!

atinux avatar Nov 09 '22 12:11 atinux

This issue could be a solution, with this, I would love to find a way to merge those two packages together. WDYT @gitFoxCode ?

Hi, sorry for the delay but the overlap of responsibilities at work and college do not allow me to deal with projects as I would like. I care about easy addition of icons to the site, you can combine the two modules into one. What I would like most is that the icons are imported only if they are used, so as not to serve the user a thousand icons where only three are used on a given page. This type of module in general should be part of the core of nuxt itself, after all, every website uses icons. The nuxt-icons module itself is in the plans to be rebuilt, I'm limited by the Vite architecture, to make it so that it would be best for the end user I'd have to really dig deep into what's going on underneath the engine - I'm not at the level of experience as the nuxt-lab programmers who could handle this with due respect. The ability to configure a particular folder, icons on demand, etc.

gitFoxCode avatar Nov 09 '22 14:11 gitFoxCode

i think that using @Atinux modules with unplugin-icons is a great addition or maybe a way to be able to use custom local json files ?

Celibioux avatar Nov 10 '22 06:11 Celibioux

any update on this?

hi-reeve avatar Mar 15 '23 03:03 hi-reeve

I know how to do it but sadly I have more important stuff to do at the moment.

Help is more than welcome though <3

atinux avatar Mar 15 '23 10:03 atinux

any update on this?

Rednas83 avatar Mar 17 '24 11:03 Rednas83

I created module for working with local icons (color and monotone) with nuxt-icon or any iconify module. https://github.com/adinvadim/nuxt-local-iconify

adinvadim avatar Apr 21 '24 12:04 adinvadim

The new version of nuxt-icon should support custom icon, see https://github.com/nuxt-modules/icon/releases/tag/v1.0.0-beta.1

atinux avatar May 03 '24 00:05 atinux