Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request - IlesIcon module #240

Open
TechAkayy opened this issue Mar 28, 2023 · 4 comments
Open

Feature Request - IlesIcon module #240

TechAkayy opened this issue Mar 28, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@TechAkayy
Copy link

TechAkayy commented Mar 28, 2023

Is your feature request related to a problem? Please describe.

It would be nice to have an iles-icon module that can provide the ability use & treeshake over 100,000 Iconify icons.

Similar to AstroIcon and NuxtIcon.

Describe alternatives you've considered

Currently, we can use unocss/preset-icons to use and treeshake iconify icons.

Sample repo - https://github.com/TechAkayy/nature-delights-with-iles (BaseIcon component used in HeroSection component)

  • Stackblitz is not loading the above repo properly, so please clone the git repo to test.

  • Due to current peer dependencies issue, to install use the force flag. Use command npm install --force

Thanks in advance!

@ElMassimo
Copy link
Owner

ElMassimo commented Mar 28, 2023

Hi 😃

Have you tried @islands/icons?

It allows you to use any icons, and with auto-import you get tree-shaking out of the box.

Here's an example in the docs.

@TechAkayy
Copy link
Author

Thanks bunch Max.

The above feature request is a little different to the unplugin-icons way.

For eg, AstroIcon & NuxtIcon, we can specify the icon name as a prop. It's quite useful especially with antfu's vs-code iconify extension (https://github.com/antfu/vscode-iconify). It delivers a great developer experience.

Also, using Icon as a special component has great flexibility and has some advantages over using the unplugin-icons way which many of us have encountered. Here are some related threads - unplugin/unplugin-icons#203, Vuetify

Shipping an IlesIcon component as part of the current @islands/icons module that supports specifying icon-names as props might be a nice win supporting both unplugin-icons & the prop way.

For eg, Nuxt icon is wrapper on top of @iconify/vue component (https://github.com/nuxt-modules/icon/blob/main/src/runtime/Icon.vue). They also have another version called IconCSS (fetches the icon from iconify api at build/ssr time).

@ElMassimo
Copy link
Owner

I like the idea, I think it would make sense to favor this approach in @islands/icons.

Would like to know whether that approach would support configuring and using custom icons, as that's currently possible with unplugin-icons with very little effort.

@ElMassimo ElMassimo added the enhancement New feature or request label Mar 30, 2023
@TechAkayy
Copy link
Author

TechAkayy commented Mar 30, 2023

AFAIK, Iconify already provides some robust utilities to load custom icons.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants