Can we open a lightning component using URL button to open in new tab? If yes, can you kindly let me know what URL to use for that and how to pass parameters?

We have tried using quick action, but the modal dialog flashes once before the new tab opens. Is there anyway to solve this ? We wanted to use quick action , instead of the the custom URL Button.

1 Answer 1


Yes, you can use window.open(url, windowName, [windowFeatures]) method MDN Web Docs Where the second windowName param specifies the name of the browsing context (window, iframe or tab) into which to load the specified resource.

// cmp

    <aura:attribute name="someParam" value="paramValueYouWantToPass" type="String"/>
    <lightning:button label="Click to open a new page and pass a param" value= 
    {!v.someParam}" onclick="{!c.onClick}" />

// controller

    onClick: function (component, event, helper) {
        const someParamValue = component.get('v.someParam');
        window.open(`https://yourUrl.com?param=${someParamValue}`, '_blank');
        // Passing '_blank' as the second param ensures that the page with 
        // the specified URL and parameter opens in a new tab.
  • Inside window.open, what value to pass along if I want to open a target lightning component? Also, is the component provided above be added as custom lightning button or quick action in the source screen? Please clarify Apr 11, 2019 at 2:27
  • Can anyone please clarify? Otherwise we are failing to understand the approach Apr 16, 2019 at 15:19
  • OP's question is referring to opening a lightning component from a custom button in a new tab with a quick action. This answer addresses opening a url in a new tab from a lightning component May 21, 2019 at 1:24
  • @Sagnik take a look at $A.createComponent()
    – dibocor
    Nov 3, 2019 at 7:42

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.