I have to open my lightning component on click of a button which is at opportunity layout in lightning experience. I have tried using actions by creating a vf page but its not looking good. Is there is any way to done the on click functionality.


2 Answers 2


You can encapsulate your Lightning Component using the Modal component provided by Lightning Design System.

  <div aria-hidden="false" role="dialog" class="slds-modal slds-fade-in-open">
    <div class="slds-modal__container">
      <div class="slds-modal__header">
        <h2 class="slds-text-heading--medium">Modal Header</h2>
        <button class="slds-button slds-button--icon-inverse slds-modal__close">
          <svg aria-hidden="true" class="slds-button__icon slds-button__icon--large">
            <use xlink:href="/assets/icons/action-sprite/svg/symbols.svg#close"></use>
          <span class="slds-assistive-text">Close</span>
      <div class="slds-modal__content">
      <div class="slds-modal__footer">
        <div class="slds-x-small-buttons--horizontal">
          <button class="slds-button slds-button--neutral">Cancel</button>
          <button class="slds-button slds-button--neutral slds-button--brand">Save</button>
  <div class="slds-backdrop slds-backdrop--open"></div>
  • 1
    is there is any way to open the component on click of a button and The button is on the standard opportunity page in lightning experience?
    – Amjad khan
    Commented Jan 12, 2016 at 9:08

Well you can try custom action bar button to open your modal

Here is an example

<aura:component implements="force:lightningQuickAction>
//Your modal code goes here

You can add a lightning based action button inside

Setup -> Quick Find -> Object Manager -> opportunity

Try to add a Action button by choosing option as lightning component

After you can add this button inside component layout by dragging this into lightning and salesforce1 field.

Here is some useful links



You must log in to answer this question.

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