question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add icons dynamically

See original GitHub issue

Hi, awesome work with this plugins man, enjoying a lot playing around with vueuse and this one.

Which would be the approach to dynamically insert icons? Let’s say I have a menu metadata in a js object and icon is one of the properties.

One option I guess would be to use <component :is="menuitem.icon"> where icon: IconAccountBox .

Would make sense to add a component <icon :name="carbon-icon" /> to the repo?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
antfucommented, Jan 13, 2021

Made an issue to track on that.

1reaction
antfucommented, Jan 13, 2021

#5, you can use https://github.com/antfu/purge-icons for dynamic loading and this for statical bunding. Guess I should update the README about this 😅

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to add font awesome icon dynamically from JS file?
I'm trying to add font awesome icons ...
Read more >
Add icons dynamically · Issue #7 · antfu/unplugin-icons - GitHub
Which would be the approach to dynamically insert icons? Let's say I have a menu metadata in a js object and icon is...
Read more >
how to add font awesome icons to dynamically created li's ...
how to add font awesome icons to dynamically created li's using javascript. ... Just remove the element which contains the icon. Select the ......
Read more >
Dynamically Adding Icons to Fields | Fusion 5.7
Sometimes you might want to dynamically prepend a field with an image or an icon depending on the value of a field or...
Read more >
Add Icons with React | Font Awesome Docs
There are a few ways to add icons when using React. The easiest way is to use Dynamic Icon Importing which automatically imports...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found