FeatureRequest: Model for dynamically referencing icons
See original GitHub issueWhat is the cleanest way to dynamically include an icon in a React component? eg when an icon name is passed as a prop to the component and the component needs to display the icon.
The structure of the packages do not lend themselves to import IconSet from '@iconify/icons-[set]'
and use IconSet[iconname]
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Create icon component dynamically and append it to element
I'm trying to create a dynamic icon component and append it to an element. I have a directive that creates a badge with...
Read more >Feature request: IOS dynamic app icons | Voters - Expo
Since iOS 11.3, app can specify more app icons and can switch between them using code. It is quite easy, but requires bundling...
Read more >Font Awesome 6 (beta) and dynamic icon name in Next JS
The way you import your icons uses a babel macro. It means that the referenced icon must be known at build time. It...
Read more >Dynamic Icon for Garadget - Home Assistant Community
Hello HA Community, I have two Garadget Covers for my Garage which I love, however, I'm looking for a way to Dynamically change...
Read more >Issues for Dynamic Entity Reference | Drupal.org
Title Status Priority
Drupal Coding Standards Issues | phpcs Needs work Normal
field_storage_dependencies Postponed (maintainer needs more info) Normal
Use virtual index instead of triggers Active...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Its not out of scope though 😃
I am working on Iconify version 2 right now. It is modular package that shares source with SVG framework, so it would be quite easy to implement React component with API. If you do want React component with API support, I can make one.
Forgot to mention: unlike SVG framework that uses simple JSONP to retrieve data from API, React component uses XMLHttpRequest. This is experimental thing. I’ll be testing how it works.
If you want to revert to JSONP behaviour, replace this line in
src/icon.ts
:with
and rebuild package.
To rebuild package first in root directory run
npm install
andnpm run bootstrap
to install all dependencies and create links between packages, then inpackages/react-with-api
runnpm run build
to build it.