lightning:actionOverride

Add the lightning:actionOverride interface to a Lightning component to enable the component to be used to override a standard action on an object. You can override the View, New, Edit, and Tab standard actions on most standard and all custom components. This interface has no effect except when used within Lightning Experience and Salesforce1.

This interface is a marker interface. A marker interface is a signal to the component’s container to add the interface’s behavior to the component. You don’t need to implement any specific methods or attributes in your component, you simply add the interface name to the component’s implements attribute.

The lightning:actionOverride doesn’t add or require any attributes on components that implement it. Components that implement this interface don’t automatically override any action. You need to manually override relevant actions in Setup.

Only components that implement this interface appear in the Lightning Component Bundle menu of an object action Override Properties panel.

Example

This example shows the markup required to add the lightning:actionOverride interface to a Lightning component.

<aura:component 
    implements="lightning:actionOverride,force:hasRecordId,force:hasSObjectName">
    
    <article class="slds-card">
      <div class="slds-card__header slds-grid">
        <header class="slds-media slds-media--center slds-has-flexi-truncate">
          <div class="slds-media__body">
            <h2><span class="slds-text-heading--small">Expense Details</span></h2>
          </div>
        </header>
        <div class="slds-no-flex">
            <lightning:button label="Edit" onclick="{!c.handleEdit}"/>
        </div>
      </div>
      <div class="slds-card__body">(expense details go here)</div>
    </article>
</aura:component>

In Lightning Experience, the standard Tab and View actions display as a page, while the standard New and Edit actions display in an overlaid panel. When used as action overrides, Lightning components that implement the lightning:actionOverride interface replace the standard behavior completely. However, overridden actions always display as a page, not as a panel. Your component displays without controls, except for the main Lightning Experience navigation bar. Your component is expected to provide a complete user interface for the action, including navigation or actions beyond the navigation bar. Component example as rendered in Lightning Experience