nuxt / icon

The <Icon> component, supporting Iconify, Emojis and custom components.
https://stackblitz.com/edit/nuxt-icon-playground?file=app.vue
MIT License
930 stars 52 forks source link

[question] Why not using `icon` as a prop instead of `name`? #51

Closed ojvribeiro closed 1 year ago

ojvribeiro commented 1 year ago

Although it looks redundant, Iconify uses <Icon icon="..." /> as the Vue component. Since this module uses Iconify, why not keeping the same structure so we can just copy the component from their lib? An alias prop would be welcomed if I'm sounding too radical 😋 That way we can use both name and icon.

cannap commented 1 year ago

i think because name is the "name" of the icon and icon could be confused because you dont pass an actual icon xD but not sure

ojvribeiro commented 1 year ago

Yeah, I totally agree that name makes more sense than icon, but still. That would be nice to be fully compatible with the way Iconify puts it. Maybe an icon alias should do the trick, just like we have to and href for the NuxtLink component.

atinux commented 1 year ago

I agree with @cannap and personally found the Iconify component not using the right prop name.

Giving an alias is not a solution IMO since then people will have different way of using it. Convention over configuration.

Also, one day I could not depend on Iconify icon but implement a more performant one for instance.