SalesforceBlue

Feel the rhythm of Salesforce

Aura

Aura Application Simplified

It is a top-level container element that can contain any other aura component or any valid HTML tags.

Below are the steps required to create an aura application:

1.Go to Setup > Click on Developer Console.


2. Go To File > New > Lightning Application.


3. Enter the name of the app and click Submit. We have given the name as “MyAwesomeApp”


4. An editor will open which will look like below.


5. Add the following code in the MyAwesomeApp.app

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

In the above code block, we have added another component – MyAwesomeComponent which we have created in the previous part.

In the aura:application tag we have added an attribute extends with value force:slds because an aura application doesn’t inherit lightning CSS of its own. We have to declare this manually.

Let’s also add few lines of code in the aura component which we have created in the previous part – MyAwesomeComponent.

<aura:component>
    <lightning:card title="AwesomeAuraComponent">
        <p class="slds-p-horizontal_small">
            <p>Hey, Welcome to the learning journey of Salesforce Lightning Aura Components!</p>
        </p>
    </lightning:card>
</aura:component>	

6. Click on the preview button.


7. A browser window will open up with the following output.


Thank you for visiting SalesforceBlue.in
If you have any queries feel free to write down a comment below 🙂


2 thoughts on “Aura Application Simplified

  • vijay kumar nalluri

    how can we add 2 components in an application side by side

    Reply
    • Pankaj Agrahari

      Hi Vijay,

      If you are looking to add two components in an aura application such that when it renders on the screen it appears side by side, for this there are few ways such that you can write custom css or you can use slds libraries. Please do share more inputs on exactly what your use case is so can share more on it.

      Thanks!

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *