How to use SLDS icons in LWC?
I have slds-nav-vertical which will iterate the list with the icon. I'm using slds-icon_container But icon is not coming. It looks like Below.
On clicking the above link getting following error Uncaught TypeError: Cannot read property 'menuItemId' of undefined throws at
aria-current="true" onclick={studentInformation}>
title="Description of icon when needed">
<svg class="slds-icon" aria-hidden="true">
xlink:href="/assets/icons/standard-sprite/svg/symbols.svg#account">
</svg>
Description of icon when
needed
{stu.Name}
Use lightning-icon component, it's prebuilt in LWC framework.
All SLDS icons are supported out of the box in this component.
Refer to detailed documentation.
You can also get the icon on the button by just specifying the name of the icon.