Inherited Lightning Component Attributes

A Child component that extends a Parent component inherits the attributes of the Parent component.

Let’s start with a simple example. Here in below example c:Parent has a description attribute with a value of “Hello!!”, and c:Child extends c:Parent by setting extends="c:Parent" in its aura:component tag.

Parent Component:

<aura:component extensible="true">
    <aura:attribute name="description" type="String" default="Hello!!" />
    <p>Description: {!v.description}</p>

Child Component:

<aura:component extends="c:Parent">
    <aura:set attribute="description" value="Hello World!" />

Test App:

<aura:application extends="force:slds">
    <c:Parent />
    <c:Child />    

Description: Hello!!
Description: Hello World!