0

I am using lightning:icon tag to display icon in my lightning component. Some icons are working fine and some are throwing error.Below is the code which is not working.

<lightning:icon iconName="Utility:expand_alt" class="slds-icon slds-icon_small" size="small" alternativeText="Expand"/>
<lightning:icon iconName="Utility:contract_alt" class="slds-icon slds-icon_small" size="small" alternativeText="Contract"/>

Error:

enter image description here

1 Answer 1

4

That's because Javascript is case sensitive and it will be "utility" not "Utility"

<lightning:icon iconName="utility:expand_alt" class="slds-icon slds-icon_small" size="small" alternativeText="Expand"/>
<lightning:icon iconName="utility:contract_alt" class="slds-icon slds-icon_small" size="small" alternativeText="Contract"/>
1
  • Works,I did silly mistake. Thank you. Apr 28, 2020 at 11:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.