antfu-collective / icones

⚡️ Icon Explorer with Instant searching, powered by Iconify
https://icones.js.org
MIT License
5.13k stars 252 forks source link

When in use with unplugin-icons, I only need the name of the component like 'MdiLightAlarmPlus' #46

Closed Bobakanoosh closed 2 years ago

Bobakanoosh commented 2 years ago

When using unplugin-icons, my flow is:

  1. Find an icon on icones
  2. Click "Vue" under the components section
  3. Paste the copied component into my editor
  4. Copy the component name from the snippet's export
  5. Then use it like a component <MdiLightAlarmPlus/>

Ideal flow would be:

  1. Find an icon
  2. Click a button that copies the text MdiLightAlarmPlus
  3. Use it like a component

I'm open to making a PR for this, just wanted to ask before doing so to see if there would be a preferred implementation for it.

antfu commented 2 years ago

Yeah, that is also a thing I want for a while. Ideally, I think we could have a panel of setting to configure copying to different formats. For example

PR would be greatly welcome, thanks!

Bobakanoosh commented 2 years ago

My qualms with it being a setting is that if you're context switching between several projects throughout the day that use different versions, now you have to consistently change that setting.

What about a dropdown arrow next to the current copy button: image

That when clicked, opens a menu that shows each of those options, and then clicking them just copies that version.

antfu commented 2 years ago

That's a good idea. We could also persist the user choice for multiple copying with same format

antfu commented 2 years ago

I will work on it

SarcevicAntonio commented 2 years ago

What about the import path for unplugin-icon when not using auto-import e.g. ~icons/mdi/abjad-arabic? 🙈