Building your first Lightning Component

Many of salesforce developers are migrating from Salesforce Classic to Lightning. Here is what we build our first lightning component.

PreRequisit:

  • Basic knowledge about HTML.
  • Basic knowledge about Salesforce.

Benefits:

  • You can build your own lightning component.
  • Kick start your career in lightning.
  • You will get to know about lightning application.
  • How you can use lightning component in VF page or not.

How to Build:

  • Login into your environment and go to Developer Console.
  • Click on the file menu in the menu bar, and click new lightning component.
  • Name your Component as “HelloWorld”
  • Click Submit.
  • Enter the text “Hello Lightning”
  • You can not view this lightning component directly, to view this lightning component you can create a lightning component tab, include this component to lightning app.
  • Here we will be creating a lightning app, to view this component.
  • Click on File menu in menu bar.
  • Click New –> Lightning Application.
  • Name it as “HelloWorldApp”
  • Click Submit.(If you want to use this lightning app in VF page or outside aura framework, then only you need to select “Lightning Out Dependency App” checkbox.)
  • Add your lightning component in lightning App, and then save your application.
  • To preview lightning application click Preview button on right side top of the screen, and here your output is to you on the screen.
  • Your first lightning component is ready.

1 thought on “Building your first Lightning Component

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.