0

Here is the code of my html file in LWC:

<div>
    <lightning-button label="Update" onclick={connectedCallback} class="slds-button_icon">
        <svg class="slds-button__icon" aria-hidden="true">
            <use xlink:href="/assets/icons/utility-sync/svg/symbols.svg#sync"></use>
        </svg>
    </lightning-button>
</div>

Why a button with a label, and not an icon?

1

Just use icon-name to specify an icon:

<lightning-button icon-name="utility:sync" ...>
</lightning-button>

See this demo.

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.