Salesforce Lightning

Welcome to the Salesforce Lightning Tutorial. Every company requires a Customer Relationship Management (CRM) tool to manage customer interactions. It provides a simple interface for data that helps companies recognize and communicate with customers. It helps in gaining new customers and retaining existing ones. Salesforce Lightning transforms the way that companies interact with their customers. In this post, we will give you a brief overview of Salesforce Lightning. If you are a beginner and wish to start working with Salesforce Lightning, then here's your chance. By the end of this tutorial, you will gain knowledge on what Salesforce Lightning is, what are the components involved in it, how to create components, and applications, etc. Let us get started.

What is Salesforce Lightning?

Salesforce is an integrated CRM platform used by many companies for marketing, sales, service, and commerce teams. Salesforce Lightning is a component-based framework from Salesforce for developing applications. We can build responsive applications suitable for any device. We can add themes, branding elements, and personalize content with just a few clicks. It provides a dynamic application development approach where we can build single-page applications.

Start learning Salesforce lightning training from hkrtrainings to make a bright career in the world of Salesforce!

Features of Salesforce Lightning

Salesforce Lightning contains the below features.

1.Lightning Experience

It provides a graphical user interface through which we can create a fast and customized user experience for the sales team to sell the products easily.

2.Lightning App Builder

It provides drag-and-drop functionality, which enables customized app creation. We can create custom pages for the Salesforce mobile app and Lightning Experience. We can configure Lightning apps here.

3.Lightning Component Framework

It is a UI framework through which we can create web apps for mobile and desktop devices. It provides tools and extensions for developing reusable components. The platform uses JavaScript on the client-side and Apex on the server-side.


AppExchange is like a store for Salesforce. It contains over 5000 ready-to-install solutions, and 6 million customer installs that help in solving business challenges. It also contains 50 partner components. 

5.Design System

The Salesforce Lightning Design System (SLDS) offers a styling framework for enhancing the look and feel of your applications without having to write CSS code. We can add icons, font, color palettes to create Lightning Experience.

6.Lightning Connect

It helps to connect apps to access data from external sources that comply with OData specification. We can access data from systems like SAP, Oracle, etc. without copying it in Salesforce.

Benefits of Salesforce Lightning

Here are some of the main benefits of Salesforce Lightning.

  • Out-of-the-box components - It provides 175 features more than Salesforce Classic.
  • Reusable - It provides reusable components that can be used across multiple applications.
  • Independent - The components will have minimal dependencies, so it can be deployed in any system.
  • Integration with Einstein AI - It provides forecasting to better qualify leads.
  • Faster performance - It increases efficiency, thereby improving performance.
  • Extensible - It provides object-oriented architecture.
  • Event-driven architecture - It offers event handlers to handle events.
  • Faster development - We can create applications faster and easier.
  • Customizable home page - We can customize the home page according to our needs.
  • It is built on top of the Aura framework, which simplifies app logic.
  • The dashboard now provides four columns.
  • It provides drag-and-drop status changes.
  • It simplifies processes for users who have less or no programming knowledge.
  • It provides information security that prevents Lightning components of different namespaces from interacting with each other.
  • We can perform a GAP analysis to outline all areas of risk.

Salesforce Training

  • Master Your Craft
  • Lifetime LMS & Faculty Access
  • 24/7 online expert support
  • Real-world & Project Based Learning

Setting up the Lightning environment

To enable Lightning development, follow these steps. First, we have to create a Namespace. It is unique across all Salesforce organizations. Login to your Salesforce Developer Edition account. 

Click on 'Setup' on the top-right corner. Click on 'Create' from the left-side menu and select the 'Packages' option. Click on 'Edit' and then on 'Continue'. Give the namespace prefix and click on 'Check Availability'. If the namespace is available, click on 'Review My Selections' and click on 'Save'. Navigate to 'Setup', click on 'Develop', and then on 'Lightning Components'. Select the 'Enable Lightning Components' checkbox, and then click on 'Save'.

Check out here for frequently asked salesforce interview questions & answers

Let's setup bootstrap to make our applications more flexible. Salesforce provides a customized version of Twitter Bootstrap that we can use. Go to and click on 'Download'. Once the download is complete, unzip the package. Navigate to 'Setup' in Salesforce and click on 'Build'. Click on 'Develop' and select the 'Static Resources' option. Click on 'New', and you will get some options to fill. Give the name and description. Upload the Bootstrap package (bootstrap.css) that is present in the 'dist/CSS' directory of the unzipped bootstrap folder. Click on 'Save' to complete the process. Now your Lightning environment is ready.

Create your first Lightning Component

A lightning component is referred to as a reusable unit of an application. Open the Developer Console from your Salesforce Lightning Experience. Go to 'File' in the top-left menu. Click on 'New' and select the 'Lightning Component' option. Give the name as 'LightningComponent' and description of the lightning component. Click on 'Submit' to create the component. It will open two tabs by default - the 'LightningComponent' tab and the 'LightningComponent.cmp' tab. Replace the content of the 'LightningComponent.cmp' tab

Save the file by ctrl + s and close the tab. We can't see the output of a component unless we use it in a lightning application.

Subscribe to our youtube channel to get new updates..!

Creating a Lightning Application

In the Developer Console, go to 'File' in the top-left menu. Click on 'New' and select the 'Lightning Application' option. Give the name as 'SampleApplication', enter the description, and click on 'Submit'. This creates a lighting application bundle. It will open two tabs by default - the 'SampleApplication' tab and the '' tab. Replace the content of the '' tab 

LightningComponent is the name of the lightning component that we created in the above section. This connects your application with the specified lightning component. Save your application by ctrl + s. Click on 'Preview' from the application bundle on the right-side. A page opens up with the text below.

This is my first Lightning Application

This is a sample Lightning Component

Congratulations, you have successfully created a lightning application and connected a lightning component to it.

[Related Article: Salesforce Tutorial]

Attributes and Expressions in Lightning Components

While we create a Lightning Component, we can use attributes and expressions to make the component dynamic. It holds values, and we can reuse them in the code. We can add attributes with the help of tags. An attribute name should start with an alphabet or underscore. It can only contain alphanumeric or underscore characters. Attributes in Lightning are very similar to markup language. Here are the attribute types that lightning supports.

  • Basic type
  • Function type
  • Object type
  • Standard and Custom type
  • Collection type
  • Custom Apex Class type
  • Framework Specific type

An expression is for calculation with property values and other information. Expressions are useful for giving dynamic outputs or getting values to the component dynamically. An expression can be a combination of variables, literal values, sub-expressions, and operators. We can only declare an expression inside an attribute within the tags. Expressions are case sensitive.

Salesforce Training

Weekday / Weekend Batches


Salesforce Lightning is an intelligent customer relationship platform that helps organizations to sell faster and smarter. It provides the latest innovation in improving the users' experience. Salesforce Lightning is introduced to help the 150,000 customer base more successful. It lets you engage deeply with your customers and build unique relationships with them.

other related articles: 

Find our upcoming Salesforce Training Online Classes

  • Batch starts on 28th Sep 2023, Weekday batch

  • Batch starts on 2nd Oct 2023, Weekday batch

  • Batch starts on 6th Oct 2023, Fast Track batch

Global Promotional Image


Request for more information

Ishan Gaba
Ishan Gaba
Research Analyst
Ishan is an IT graduate who has always been passionate about writing and storytelling. He is a tech-savvy and literary fanatic since his college days. Proficient in Data Science, Cloud Computing, and DevOps he is looking forward to spreading his words to the maximum audience to make them feel the adrenaline he feels when he pens down about the technological advancements. Apart from being tech-savvy and writing technical blogs, he is an entertainment writer, a blogger, and a traveler.