Tuesday, 8 September 2020

Create your first lightning web component

Arpit Sharma
In this article we are going to create our first lightning web component, So Let's start 

Prerequisite -

1.  We should have VS code installed in our system.
2.  VS code should have required plugin for Salesforce.
3.  Connect your org to VS code

Here are steps to create lightning web component in VS code.

Step 1 - 
Press Ctrl + Shift + P in windows VS code.

Step 2 - 
Type SFDX : Create lightning web component and Press Enter

Step 3 -
Type required web component name, In my case it will be LW_HelloWorld, then press Enter.
It will automatically create below three files - 
- LW_HelloWorld.html
- LW_HelloWorld.js
- LW_HelloWorld.js-meta.xml

Step 4  - 
Paste below code in your LW_HelloWorld.html

<template>
    Hello World
</template>

So here we go, we have successfully created our first lightning web component. In next article we are going to learn, What is use of above each file and how we can run above project.

About the Author

Arpit Sharma / Author & Editor

Certified Salesforce Developer | Salesforce Developer at Cognizant | Blogger