function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Chandra Kant BaghelChandra Kant Baghel 

How to display icon in custom html button in LWC?

Hi All,

I have created a custom html button in LWC like follow:
 
<button class="custButton" data-title="Some Title" onclick={handleButtonClick}>ClickMe</button>

I wish to add a icon (like approval icon) inside this button itself.

Can anybody suggest how can we do it?
mukesh guptamukesh gupta
Hi Chandfra,

 
<button class="slds-button slds-button_icon slds-button_icon-brand" title="approval">
  <svg class="slds-button__icon" aria-hidden="true">
    <use xlink:href="/assets/icons/utility-sprite/svg/symbols.svg#approval"></use>
  </svg>
</button>


Below url will help for your  solution

https://www.lightningdesignsystem.com/components/button-icons/

 
if you need any assistanse, Please let me know!!

Kindly mark my solution as the best answer if it helps you.

Thanks
Mukesh
Chandra Kant BaghelChandra Kant Baghel
Hi Mukesh
It is not showing the icon.
And where do we add the label for button?