Skip to main content
New
Stack Overflow Jobs powered by Indeed: A job site that puts thousands of tech jobs at your fingertips (U.S. only). Search jobs

Questions tagged [lightning-button]

A lightning:button component represents a button element that executes an action in a controller. Clicking the button triggers the client-side controller method set for onclick. Buttons can be either a label only, label and icon, body only, or body and icon.

Filter by
Sorted by
Tagged with
0 votes
0 answers
30 views

LWC Lightning-Button change background color disabled button

Hi all, I would like to style the 'disabled' lightning-button the same as the 'black' button, however when using the following code this is not showing correctly inside my LWC. Is there a different ...
Yannis De Cuyper's user avatar
0 votes
0 answers
20 views

When hovering over a menu item in a Lightning Button, it gets surrounded by a blue line

I created a button in LWC to bulk download files. As shown below, when hovering over a menu item, it gets surrounded by a blue line. I want to make it so that the blue line is not displayed when ...
Yuka Fukuchi's user avatar
0 votes
0 answers
16 views

How to render the label of a lightning-button in a lightning-datatable but disable the lightning-button onclick functionality itself?

This is linked somewhat to the questions here and here. I have a lightning-datatable that has a column that is a lightning-button which, when clicked, invokes a lightning-modal. The UX behavior that I ...
Andy Hitchings's user avatar
0 votes
3 answers
4k views

Remove Focus Around Buttons on Click

I have a button named 'Apply Filters' and onclick of that button I am filtering data.I want to remove focus from the button once we are done clicking. Once the button is click only on the click the ...
Hira Khan's user avatar
0 votes
1 answer
194 views

Usage LWC in flow returns error when package creation

I used the LWC component which works on orgs of all types (sandboxes, scratches, etc) and used in screen flow. There were no errors when I've ever deployed to these orgs. BUT When I've tried to create ...
oldgunner's user avatar
0 votes
1 answer
837 views

How to add class to button in LWC

I've been tasked with converting an Aura component into a LWC. It went well except that I can't seem to add a custom class to the lightning-button for styling. When I look in the rendered code, I ...
Scarrien's user avatar
  • 133
0 votes
0 answers
229 views

Problem with Lightning-button LWC

Hello guys I have being working on a LWC custom form that has a lightning-button that do some action. I have notice that what I am in the same row of the button but outside this button and I make some ...
TechGuy's user avatar
  • 107
0 votes
1 answer
2k views

play with button radius LWC

Hello everybody I was wondering if anybody could help me. I want to round the lightning-button in a LWC. I found something like this 'border-radius-circle' but it does not work. Could anybody put an ...
TechGuy's user avatar
  • 107
0 votes
1 answer
718 views

Pass record Id from list row to controller using lightning:button

I have build a lightning component that I want to give some more additional features. By the hit of a button I want the according record to get updated. This is what it looks like as for now: ...
Jan Tonnet's user avatar
0 votes
2 answers
326 views

LWC - Create Copy Button (Closed)

I use this code to create a button (Lightning Component) on Account object to copy information from Shipping Address to Billing Address but it did not work, can you guys help me to look at my code? ...
Pam's user avatar
  • 107
0 votes
1 answer
103 views

Not getting the dynamically added CSS classes using component.find('myCmp').get('v.class') in aura

I am working on a dual stateful button, so I'm adding and removing the 'slds-is-pressed' class in the component controller file on button click. The logic is working as expected- the button states are ...
Prapti's user avatar
  • 45
-1 votes
1 answer
736 views

How to add new line in Table onclick buton? LWC

HTML : <template> <div class="slds-var-m-top_large slds-var-p-right_medium"> <lightning-layout horizontal-align="left" vertical-align="end"> ...
user avatar
0 votes
0 answers
45 views

Invalid Parameter id for Button on Opportunity List View

I am creating a button on the list view page of opportunity but it's showing that Invalid Parameter Id. This the code that I'm using in while creating a button: https://composer.congamerge.com ?...
Piyush Dwivedi's user avatar
0 votes
1 answer
5k views

How does slot attribute works in lightning-button?

I have the below example where a slot attribute is passed to the lightning-button to align with the lightning-card. Is there a documentation where I could read more about the slot property? <...
Krishnamurthy's user avatar
2 votes
2 answers
2k views

Lightning Web component download link give errorduringprocessing.jsp

I have an experience cloud site with a lightning web component that contains a download link. Clicking the download link produces the following error: top.location='https://{domain}.cs196.force.com/...
Dave's user avatar
  • 61
1 vote
2 answers
4k views

How to navigate to Custom Lightning Tab (having lwc) through lightning button having recordId in parameter? [duplicate]

I am trying to navigate to lightning tab which displays a lwc. I have a custom object and in lightning I have created one button and I am passing /lightning/n/ComponentTab?id={!record.Id} this in url ...
abhi saxena's user avatar
0 votes
1 answer
1k views

Displaying button group vertically

I'm using lightning-button-group in my LWC component however, by default it displays the grouped buttons horizontally - in one row. How would I change it to display vertically? Thanks.
newbiedev's user avatar
0 votes
1 answer
1k views

Navigate To New Tab From Link in Datatable

Currently I have a lightning:datatable of items where the last column is a button. When clicked, the button kicks off the onrowaction event handler, which uses the lightning:navigation to navigate to ...
jbyrd's user avatar
  • 641
0 votes
1 answer
2k views

How to add delay to the spinner till the Queable job gets completed [closed]

we have a lightning button on community. when we click on it a queable class gets triggered and it will update forms status. whenever I am clicking on the button it is taking some time to update the ...
user96288's user avatar
0 votes
1 answer
675 views

How to open a new form on top of the current one when clicking the button? [closed]

I have a "new" button in my aura component (lightning: button). When I click on this button, I want to open a new form ("New Contact") on top of the current form, in which I need ...
unique user's user avatar
0 votes
1 answer
2k views

Title attribute not working on a command button with Disabled = true in LWC

I have a lightning-button and want to display a tooltip/hover text whenever the button's disabled attribute is true. <lightning-button variant="brand" label="Test Button 1" data-...
NoviceSfdc's user avatar
-1 votes
1 answer
805 views

Download a custom report into Excel on click of a custom button in lightning aura component

I have a requirement, where i need to download a custom report in excel format once i click on a custom button in Lightning aura component.
TKD's user avatar
  • 11
0 votes
1 answer
237 views

I have a Search Order Lightning Component that has a button that will open again the Lightning Component in a new subtab

I have a Search Order Lightning Component that has a button that will open again the Lightning Component in a new subtab but upon opening the component I want to fetch the values and still display the ...
Atoc's user avatar
  • 37
1 vote
1 answer
4k views

How to align button to right and vertical center inside a division?

I want to display a text and two buttons inside a <div> in a <aura:component>. When I use the following code: <div style="background-color:blue; margin:2px; padding:10px;" > <...
Jayesh Babu's user avatar
0 votes
1 answer
1k views

How to toggle cursor pointer on lightning button

I'm having a lightning button called "Submit". I have added css property to that button to display it in red color. When I click on that button, I want to change my cursor pointer style to 'not-...
sfdcOwl's user avatar
  • 25
0 votes
1 answer
1k views

Button icon with possibility of passing parameters and get element

I have a IconButton , but to pass parameters to the JS, I use regular Icon with span like this : <span onclick="{!c.copyLink}" data-theurl="{!item.path}" data-caseid="{!item.id}" > <...
Raphael D's user avatar
  • 616
0 votes
1 answer
524 views

Remove highlight from current tab when button is clicked again, I am using setTabHighlighted() to highlight current tab

I have created aura component to highlight tab onclick of button and it is working as expected. But I want to remove that highlight from tab when button is clicked again, not sure how to do this. ...
Snehal's user avatar
  • 37
1 vote
1 answer
10k views

Dynamically set the onclick function in LWC button

I'm trying to dynamically set the onclick function of lightning web component button but it's not working. I've tried both "click" and "onclick" JS: const navButton = this.template.querySelector('....
626's user avatar
  • 273
8 votes
3 answers
16k views

How to make buttons in a lightning-datatable smaller in LWC?

I have a lightning-datatable in my Lightning Web Component (LWC) that has several buttons in each row (first button only shown here): These standard-sized buttons consume quite a lot of vertical ...
Keith C's user avatar
  • 136k
0 votes
1 answer
2k views

LWC - Why is the computed rowId for my custom data type in lighting-datatable undefined?

I have a custom lighting-datatable where the last row is a column that contains two buttons. When either of these buttons is pressed, I am attempting to retrieve the rowId of the row where the button ...
DylanR's user avatar
  • 107
6 votes
1 answer
934 views

LWC - How to communicate property changes down the hierarchy

By following a tutorial (How to use custom LWC lightning component in lightning-datatable) I was able to extend lightning datatable and insert a button into the final column. Now, I am currently ...
DylanR's user avatar
  • 107
0 votes
2 answers
3k views

How to open buttons of datatable in a new tab?

I am using a datatable to show record details. It has a view button that will take the user to the respective record. I want to open record in a new tab. Right-clicking a button does not show the open ...
Koustubh's user avatar
  • 1,143
-1 votes
1 answer
216 views

Callback method isn't executing

My callback method isn't executing when trying to run multiple helper functions in a single controller method. -----------------------------------------------------------------Solved-----------------...
Tyler's user avatar
  • 91
1 vote
0 answers
281 views

How do I open a Visualforce PDF page from a Lightning component button?

I have a lightning component (called from a quick action), on which a few inputs are taken. On clicking of a button I need to show a Visualforce PDF page. Can I do so directly from the button or do I ...
Irene's user avatar
  • 1,839
1 vote
1 answer
5k views

Recreating lightning-button with custom color

I am trying to replicate lightning-button in my Web Component because I need to use custom colors, and supposedly you can't override the lightning-button with css to change these colors... So here is ...
BlondeSwan's user avatar
  • 1,098
5 votes
4 answers
29k views

Changing colors of lightning-button

How can I change the colors of lightning-button? I tried doing this in my css: .my-button { background-color: #14a6bc; color: #ffffff; } and applying that class to my <lightning-button&...
BlondeSwan's user avatar
  • 1,098
1 vote
0 answers
3k views

Lightning button attribute "Disabled" in "aura:iteration tag"

I'm trying to enable a lightning:button if a lightning:inputField changes. This is the aura:component: <aura:component implements="flexipage:availableForRecordHome,force:hasRecordId,force:...
Carlos Naranjo's user avatar
0 votes
1 answer
7k views

lightning:button inline edit, only show icon

I have a lightning component in which I have built a data table. In this data table I have a component for each row. Everything works fine except one cosmetic thing. The inline edit button shows an ...
user3274635's user avatar
2 votes
1 answer
746 views

Download Screenshot in PDF on button click in lightning component

I have a lightning component which displays list of accounts in table. And I need to create a button. On clicking , screenshot of the screen should be downloaded as PDF/excel file. I am not sure how ...
devforce's user avatar
  • 1,573
3 votes
2 answers
16k views

Make a lightning button constant in size

I have a lightning button in my custom component. Now the button size is dynamically changing depending on the button text. Is there any way to make it constant?
Madhurima's user avatar
  • 1,395
1 vote
1 answer
428 views

We need to uniquely identify multiple lightning components on same page( using lightning app builder)

We need to uniquely identify multiple lightning components on same page(added using lightning app builder) and we need to save respected responses and use them later. For this purpose we need a unique ...
Swati's user avatar
  • 11
0 votes
0 answers
389 views

Button text coming in two lines and increasing the length of lightning button

i have a lightning component button which has a longer text and it is going in two seperate lines and forming the following structure. Is there any way to keep it in a single line? i used the ...
Madhurima's user avatar
  • 1,395
1 vote
2 answers
8k views

Hover Text on lightning button in custom lightning component

I have a lightning component button in a custom lightning component. I want a hover text to appear on the button. Is this possible in lightning?
Madhurima's user avatar
  • 1,395
0 votes
1 answer
1k views

event.getSource is not a function

When trying to get a button's value on lightning component controller, I'm getting the following error: event.getSource is not a function This is the code on the component side: <lightning:...
Vinicius Zanquini's user avatar
0 votes
2 answers
1k views

Disable Button depending on the comparison between an attribute and list size in a Lightning component

My code is the next one: <aura:attribute name="listAddress" type="List" /> <aura:attribute name="rowValue" type="Integer"/> <button class="slds-button slds-button--neutral slds-grow" ...
jmarco's user avatar
  • 41
1 vote
1 answer
2k views

Enable lightning button on value entered

I have two lightning:button and a lightning:input field. What I have seen in some places is that. Some buttons are enabled only when values are entered in the text boxes. Is this achievable in ...
Rimii's user avatar
  • 361
3 votes
1 answer
19k views

Create Custom Button in Lightning that calls an Apex Class Method [closed]

I am new to Lightning and I would like to create a Custom Button (or maybe an Action) that just calls a Method in an Apex Class (in which I am sending some parameters). Is this posible to do? ...
jmarco's user avatar
  • 41
2 votes
1 answer
6k views

Lightning button Variant - To appear blue/white and appear center aligned

Trying to build a form and I put 2 buttons in the form. Want 1 of the button as to appear blue and other to appear white. I created below component: Searchform.cmp <aura:component > <!--...
SfdcBat's user avatar
  • 4,811
2 votes
2 answers
12k views

How do I make a lightning:button expand horizontally to fill a div?

Is there any way to make a lightning:button expand horizontally until it fills the boundaries of its div? I've been trying for ages but nothing I try works, is it possible or is salesforce still ...
Ben d'Straw's user avatar
1 vote
0 answers
795 views

Updating a field on record detail page with Lightning button [duplicate]

I am stuck with issue in Lightning. I want to do a field update on record page on click of a button, and will be showing a message to user on successfully updation of that field. Lets say, I am ...
Ysr Shk's user avatar
  • 3,157