0

I am creating a button , where I have to put brand as variant and also need to get lead icon on it...I tried something like this but the icon doesnt appear because of the brand...is there anyway I can change icon colour to white on this button.

<lightning:button onclick="{!c.createLead}" variant="brand" label="New Lead" iconName="standard:lead" disabled = "false"/> 

New Lead Button

If I use variant as Brand_outline , I can see the lead icon...But I cant use Brand_Outine and have to use brand only...so i thought of getting the colour changed to white for this icon...so that it becomes visible.

<lightning:button onclick="{!c.createLead}" variant="brand-outline" label="New Lead" iconName="standard:lead" disabled = "false"/>

New Lead Button 2

0

2 Answers 2

0

Only the utility category can be used in the lightning:button component.

Visit https://lightningdesignsystem.com/icons/#utility to view the utility icons.

Read more here - https://developer.salesforce.com/docs/component-library/bundle/lightning:button/documentation

0

@mohita - assuming here you are using lightning:buttonIcon on aura component. is this correct? The available variants for buttonIcon are: bare, container, brand, border, border-filled, bare-inverse, and border-inverse. Try using border-filled, container, or bare if it can address your requirement.

2
  • Actually I need to use brand only to match with other buttons on the screen. I am using lightning button. Is there any way I can set colour only for the icon and not for whole button.<lightning:button onclick="{!c.createLead}" variant="brand-outline" label="New Lead" iconName="standard:lead" disabled = "false"/> May 13, 2020 at 15:55
  • @Mohita - There is no Salesforce standard way of doing what you want to achieve. I suggest that you try if utility icon would work. Another option is to negotiate with your stakeholder not to add an icon at all.
    – wkoder
    May 14, 2020 at 12:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .