Salesforce Menu

Create your first lightning aura component

Lightning aura components are reusable single page applications which consist of markup, javascript, CSS and apex.

Salesforce provides some standard in-built aura components (located here : https://developer.salesforce.com/docs/component-library/). But we can also create our own custom aura components.

Follow the below steps to create your first aura component :

1. If you are in classic view, go to setup and open the developer console.

If you are in a lightning view, click the wrench icon and open the developer console.

2. Then, click on File->New->Lightning Component

3. Then, enter the component name and press submit.

4. In your new ‘HelloWorld’ component, add static text ‘Hello World!’.

5. In order to view this component, we need to create a lightning application. Go to File->New->Lightning Application.

6. Once your app is created, add your component to it by adding the component to the markup inside the application.

NOTE: Look at the representation of custom ‘HelloWorld’ component we created in the first step.. The ‘c’ represents default namespace of the org, basically if we need to use a managed package aura component, we need to use the package namespace otherwise we use ‘c’ for the default namespace.

7. Click on the Preview button on the right and you should be able to see the component!

OUTPUT :

Subscribe Now