Dynamic Icon loading in LWC doesn't workSVG API incomplete in LWC/LockerCan't get refreshApex() to work in lwcAccess svg icon from static resource zip fileLWC NavigationMixin does not work in CommunityLWC: How to create dynamic component in LWC?Design tokens doesn't work in LWC?Why data- attribute sometimes doesn't work?LWC design attributes doesn't work in the Community with Anonymous UserLWC: Iterate through a dynamic query resultLWC - Replace Lightning-input of type file with a icon

when to use "wait" and when "busy" mouse cursor

Just how much information should you share with a former client?

How did astronauts using rovers tell direction without compasses on the Moon?

Would people understand me speaking German all over Europe?

Complaints from (junior) developers against solution architects: how can we show the benefits of our work and improve relationships?

What are the closest international airports in different countries?

Why are subdominants unstable?

Why are we moving in circles with a tandem kayak?

Should I intervene when a colleague in a different department makes students run laps as part of their grade?

Was the Psych theme song written for the show?

Is it possible to tell if a child will turn into a Hag?

How can I convert a linear narrative into a branching narrative?

My employer is refusing to give me the pay that was advertised after an internal job move

How would a lunar colony attack Earth?

Find all the numbers in one file that are not in another file in python

What language is Raven using for her attack in the new 52?

When encrypting twice with two separate keys, can a single key decrypt both steps?

Is it possible for a particle to decay via gravity?

Solve equation using Mathematica

May a hotel provide accommodation for fewer people than booked?

When does the Homunculus die, exactly?

What is a good example for artistic ND filter applications?

Should I put my name first, or last in the team members list

Why did I lose on time with 3 pawns vs Knight. Shouldn't it be a draw?



Dynamic Icon loading in LWC doesn't work


SVG API incomplete in LWC/LockerCan't get refreshApex() to work in lwcAccess svg icon from static resource zip fileLWC NavigationMixin does not work in CommunityLWC: How to create dynamic component in LWC?Design tokens doesn't work in LWC?Why data- attribute sometimes doesn't work?LWC design attributes doesn't work in the Community with Anonymous UserLWC: Iterate through a dynamic query resultLWC - Replace Lightning-input of type file with a icon






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








2















I am using the progress-ring LWC component from https://github.com/texei/progress-ring and fail to make the SLDS SVG Icon displayed dynamic work:



Usage:



<c-progress-ring ... icon="symbols.svg#warning"></c-progress-ring>


HTML:



<template if:true=icon>
<span class="slds-icon_container slds-icon-utility" title=state>
<svg class="slds-icon" aria-hidden="true">
<use xlink:href="/assets/icons/utility-sprite/svg/icon"></use>
</svg>
<span class="slds-assistive-text">state</span>
</span>
</template>


JS:



import LightningElement, api, track from "lwc";



export default class ProgressRing extends LightningElement 
@api min;
@api max;
@api icon;
...










share|improve this question



















  • 2





    Thanks for the contribution of my component :)

    – FabienHuot
    8 hours ago

















2















I am using the progress-ring LWC component from https://github.com/texei/progress-ring and fail to make the SLDS SVG Icon displayed dynamic work:



Usage:



<c-progress-ring ... icon="symbols.svg#warning"></c-progress-ring>


HTML:



<template if:true=icon>
<span class="slds-icon_container slds-icon-utility" title=state>
<svg class="slds-icon" aria-hidden="true">
<use xlink:href="/assets/icons/utility-sprite/svg/icon"></use>
</svg>
<span class="slds-assistive-text">state</span>
</span>
</template>


JS:



import LightningElement, api, track from "lwc";



export default class ProgressRing extends LightningElement 
@api min;
@api max;
@api icon;
...










share|improve this question



















  • 2





    Thanks for the contribution of my component :)

    – FabienHuot
    8 hours ago













2












2








2


1






I am using the progress-ring LWC component from https://github.com/texei/progress-ring and fail to make the SLDS SVG Icon displayed dynamic work:



Usage:



<c-progress-ring ... icon="symbols.svg#warning"></c-progress-ring>


HTML:



<template if:true=icon>
<span class="slds-icon_container slds-icon-utility" title=state>
<svg class="slds-icon" aria-hidden="true">
<use xlink:href="/assets/icons/utility-sprite/svg/icon"></use>
</svg>
<span class="slds-assistive-text">state</span>
</span>
</template>


JS:



import LightningElement, api, track from "lwc";



export default class ProgressRing extends LightningElement 
@api min;
@api max;
@api icon;
...










share|improve this question














I am using the progress-ring LWC component from https://github.com/texei/progress-ring and fail to make the SLDS SVG Icon displayed dynamic work:



Usage:



<c-progress-ring ... icon="symbols.svg#warning"></c-progress-ring>


HTML:



<template if:true=icon>
<span class="slds-icon_container slds-icon-utility" title=state>
<svg class="slds-icon" aria-hidden="true">
<use xlink:href="/assets/icons/utility-sprite/svg/icon"></use>
</svg>
<span class="slds-assistive-text">state</span>
</span>
</template>


JS:



import LightningElement, api, track from "lwc";



export default class ProgressRing extends LightningElement 
@api min;
@api max;
@api icon;
...







lightning-web-components svg public-reactive-properties






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 9 hours ago









Robert SösemannRobert Sösemann

14.2k12 gold badges84 silver badges243 bronze badges




14.2k12 gold badges84 silver badges243 bronze badges










  • 2





    Thanks for the contribution of my component :)

    – FabienHuot
    8 hours ago












  • 2





    Thanks for the contribution of my component :)

    – FabienHuot
    8 hours ago







2




2





Thanks for the contribution of my component :)

– FabienHuot
8 hours ago





Thanks for the contribution of my component :)

– FabienHuot
8 hours ago










2 Answers
2






active

oldest

votes


















2














You can make it work using the <lighting-icon> tag.



<template if:true=icon>
<lightning-icon icon-name=iconName size="x-small" ></lightning-icon>
</template>





share|improve this answer








New contributor



dennisjsk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




























    3














    Have you tried using the <lightning-icon> tag? Documentation can be found here.



    For your code, the HTML should look something like this: (you should modify the component call a little bit, so your text for "icon" satisfies the specification (i.e. "action:approval")



    <template if:true=icon>
    <lightning-icon icon-name=icon alternative-text=state</lightning-icon>
    </template>





    share|improve this answer



























      Your Answer








      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "459"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: false,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      imageUploader:
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      ,
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );













      draft saved

      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f271795%2fdynamic-icon-loading-in-lwc-doesnt-work%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      2














      You can make it work using the <lighting-icon> tag.



      <template if:true=icon>
      <lightning-icon icon-name=iconName size="x-small" ></lightning-icon>
      </template>





      share|improve this answer








      New contributor



      dennisjsk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.

























        2














        You can make it work using the <lighting-icon> tag.



        <template if:true=icon>
        <lightning-icon icon-name=iconName size="x-small" ></lightning-icon>
        </template>





        share|improve this answer








        New contributor



        dennisjsk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.























          2












          2








          2







          You can make it work using the <lighting-icon> tag.



          <template if:true=icon>
          <lightning-icon icon-name=iconName size="x-small" ></lightning-icon>
          </template>





          share|improve this answer








          New contributor



          dennisjsk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.









          You can make it work using the <lighting-icon> tag.



          <template if:true=icon>
          <lightning-icon icon-name=iconName size="x-small" ></lightning-icon>
          </template>






          share|improve this answer








          New contributor



          dennisjsk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.








          share|improve this answer



          share|improve this answer






          New contributor



          dennisjsk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.








          answered 9 hours ago









          dennisjskdennisjsk

          1363 bronze badges




          1363 bronze badges




          New contributor



          dennisjsk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.




          New contributor




          dennisjsk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.




























              3














              Have you tried using the <lightning-icon> tag? Documentation can be found here.



              For your code, the HTML should look something like this: (you should modify the component call a little bit, so your text for "icon" satisfies the specification (i.e. "action:approval")



              <template if:true=icon>
              <lightning-icon icon-name=icon alternative-text=state</lightning-icon>
              </template>





              share|improve this answer





























                3














                Have you tried using the <lightning-icon> tag? Documentation can be found here.



                For your code, the HTML should look something like this: (you should modify the component call a little bit, so your text for "icon" satisfies the specification (i.e. "action:approval")



                <template if:true=icon>
                <lightning-icon icon-name=icon alternative-text=state</lightning-icon>
                </template>





                share|improve this answer



























                  3












                  3








                  3







                  Have you tried using the <lightning-icon> tag? Documentation can be found here.



                  For your code, the HTML should look something like this: (you should modify the component call a little bit, so your text for "icon" satisfies the specification (i.e. "action:approval")



                  <template if:true=icon>
                  <lightning-icon icon-name=icon alternative-text=state</lightning-icon>
                  </template>





                  share|improve this answer













                  Have you tried using the <lightning-icon> tag? Documentation can be found here.



                  For your code, the HTML should look something like this: (you should modify the component call a little bit, so your text for "icon" satisfies the specification (i.e. "action:approval")



                  <template if:true=icon>
                  <lightning-icon icon-name=icon alternative-text=state</lightning-icon>
                  </template>






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered 9 hours ago









                  J. LietzauJ. Lietzau

                  2551 silver badge12 bronze badges




                  2551 silver badge12 bronze badges






























                      draft saved

                      draft discarded
















































                      Thanks for contributing an answer to Salesforce Stack Exchange!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid


                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.

                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f271795%2fdynamic-icon-loading-in-lwc-doesnt-work%23new-answer', 'question_page');

                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Canceling a color specificationRandomly assigning color to Graphics3D objects?Default color for Filling in Mathematica 9Coloring specific elements of sets with a prime modified order in an array plotHow to pick a color differing significantly from the colors already in a given color list?Detection of the text colorColor numbers based on their valueCan color schemes for use with ColorData include opacity specification?My dynamic color schemes

                      Invision Community Contents History See also References External links Navigation menuProprietaryinvisioncommunity.comIPS Community ForumsIPS Community Forumsthis blog entry"License Changes, IP.Board 3.4, and the Future""Interview -- Matt Mecham of Ibforums""CEO Invision Power Board, Matt Mecham Is a Liar, Thief!"IPB License Explanation 1.3, 1.3.1, 2.0, and 2.1ArchivedSecurity Fixes, Updates And Enhancements For IPB 1.3.1Archived"New Demo Accounts - Invision Power Services"the original"New Default Skin"the original"Invision Power Board 3.0.0 and Applications Released"the original"Archived copy"the original"Perpetual licenses being done away with""Release Notes - Invision Power Services""Introducing: IPS Community Suite 4!"Invision Community Release Notes

                      François Viète Contents Biography Work and thought Bibliography See also Notes Further reading External links Navigation menup. 21Google Bookspp. 75–77Google BooksDe thou (from University of Saint Andrews)ArchivedGoogle BooksGoogle BooksGoogle BooksGoogle booksGoogle Bookscc-parthenay.frL'histoire universelle (fr)Universal History (en)ArchivedAdsabs.harvard.eduPagesperso-orange.frArchive.orgChikara Sasaki. Descartes' mathematical thought p.259Google BooksGoogle BooksGoogle Bookspp. 152 and onwardGoogle BooksGoogle BooksScribd.comGoogle Books1257-7979Google BooksGoogle BooksGoogle BooksGoogle BooksGoogle BooksGoogle BooksGallica.bnf.frGoogle BooksGoogle Books"François Viète"Francois Viète: Father of Modern Algebraic NotationThe Lawyer and the GamblerAbout TarporleySite de Jean-Paul GuichardL'algèbre nouvelle"About the Harmonicon"cb120511976(data)1188044800000 0001 0913 5903n82164680ola2013766880073431702w6vt1sb70287374827140948071409480