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
SambitNayakSambitNayak 

Change Lightning-Button Color & Size- LWC

Hi,

I'm new to LWC.
How do I change the button color and size of a lightning-button? It's taking the default from "Variant".

Alternatively, can I use anything else (like icon)?

Any help in this regard is really appreciated.
Best Answer chosen by SambitNayak
ravi soniravi soni
hi SambitNayak,
try custom button if you want to increase width of button like below.
 <button class="slds-button slds-button_destructive" style="width:250px" >My Custom Button</button>

don't forget to mark it as the best answer.
Thank you

All Answers

Omkar Tandale 28Omkar Tandale 28
Hi Sambit, you can search for SLDS. It is the Salesforce lightning design system. In that you can find many different types of buttons, by using them you can change the variant of the button. Below is the link which you can use.
https://www.lightningdesignsystem.com/components/buttons/
Let me know if this helps you. Thanks !
ravi soniravi soni
hi SambitNayak,
try custom button if you want to increase width of button like below.
 <button class="slds-button slds-button_destructive" style="width:250px" >My Custom Button</button>

don't forget to mark it as the best answer.
Thank you
This was selected as the best answer