GlossaryTechnology

Lightning Web Components

Term 134 of 268 · Technology

In one sentence

Lightning Web Components (LWC) is Salesforce's framework for building reusable user interfaces on modern web standards (JavaScript, HTML and native Web Components), with better performance and an easier learning curve than the earlier Aura model.

Reviewed by Juan Manuel Garrido

Co-founder of VantegrateLinkedIn

Lightning Web Components definition

Lightning Web Components (LWC) is Salesforce's official framework for building reusable interface components. Unlike earlier proprietary solutions, it relies on native web standards built into the browser (Web Components, ES Modules, Shadow DOM and modern JavaScript), adding only a thin platform-specific layer on top. That makes it faster and closer to what a web developer already knows.

In practice, an LWC is an encapsulated UI building block (a search box, an account card, a quote form) that lives inside a Salesforce page and talks to data through Apex or the platform's data APIs. It is the technology used to build custom experiences in Lightning Experience and Experience Cloud, part of custom development on Salesforce, the territory of Salesforce Developers.

Why LWC exists

For years, frontend customization in Salesforce was done with Aura, a proprietary framework created when the JavaScript ecosystem was still immature and browsers had no common standards for components. As the web matured (Web Components, ES modules, custom elements), Salesforce rewrote its model and launched Lightning Web Components in 2019. The underlying idea: make writing UI in Salesforce feel as much as possible like writing UI in any modern web project, lowering the learning curve and taking advantage of what the browser already provides instead of reinventing it.

How it works

Each component lives in a folder with a name and groups at least three files: the HTML (the template with the markup and data bindings), the JavaScript (the class that extends LightningElement and handles state, events and logic) and an XML metadata file that defines where the component can be used (record page, app, Experience Cloud). Optionally, it includes CSS and test files.

Data arrives in two ways: by calling Apex methods from the component's JavaScript, or by using the platform's data adapters (Lightning Data Service), which read and write records without any server-side code. The component stays encapsulated thanks to the Shadow DOM: its styles and markup do not clash with the rest of the page, which avoids the classic problem of stylesheets bleeding into each other.

Why it matters for the business

For a company running on Salesforce, LWC is what lets you go beyond standard configuration when the real process does not fit the out-of-the-box components. A sales team may need a screen that shows an account's credit risk next to its order history; a service team, a panel that combines data from several sources into a single view. Custom components solve that. And because it is built on standards, maintenance costs go down: more developers on the market have those skills, and the knowledge carries over to other web projects.

LWC vs. Aura

The most common question when evaluating technology in Salesforce is when to use each one. Salesforce recommends LWC for all new development; Aura is still supported but considered the previous model. The core difference:

AspectLightning Web ComponentsAura
Technology baseNative web standardsProprietary framework
PerformanceLighter and fasterHeavier
Learning curveClose to modern JavaScriptIts own syntax to learn
Status in SalesforceRecommended for everything newSupported, in legacy mode
InteroperabilityRuns inside Aura componentsDoes not run inside an LWC

One useful fact: both can coexist in the same org. An Aura component can contain an LWC (not the other way around), which lets you migrate gradually without rewriting everything at once.

A concrete example (Latin America)

A wholesale distributor in Argentina needed its sales reps, when opening an account in Salesforce, to see at a glance the open account balance, orders in transit and available credit limit, data that lived in three different systems. Instead of sending reps to navigate between screens, the team built a single LWC that queries those sources through Apex and shows them in one card on the account page. The result: less search time per visit and better-informed sales decisions in the moment.

Common mistakes

  • Putting heavy business logic in the component's JavaScript instead of delegating it to Apex: the frontend should orchestrate, not compute critical rules.
  • Ignoring Governor Limits: even though LWC is frontend, every call to Apex consumes server resources and there are per-transaction caps (see governor limits).
  • Hardcoding text and permissions instead of respecting the field- and object-level security defined by the user's profile.
  • Reinventing components that already exist in Salesforce's standard library (Lightning Base Components), duplicating maintenance effort.

In short, Lightning Web Components is Salesforce's modern presentation layer: the place where data living on the platform becomes a user experience designed for a specific business process.

Share
Frequently asked questions

FAQs about Lightning Web Components

What is Lightning Web Components?

Lightning Web Components (LWC) is Salesforce's official framework for building reusable user interface components. It is based on modern web standards such as Web Components, ES modules and native JavaScript, with a thin Salesforce-specific layer on top. It is the recommended technology for all custom UI development within Lightning Experience and Experience Cloud.

What is the difference between Lightning Web Components and Aura?

Aura is Salesforce's earlier proprietary framework; LWC is the modern model based on the browser's web standards. LWC is lighter, faster and has a gentler learning curve because it looks like any current JavaScript project. Salesforce recommends LWC for all new development and keeps Aura in legacy mode. Both can coexist in the same org: an Aura component can contain an LWC, which allows a gradual migration.

Do I need to know Apex to build Lightning Web Components?

For simple record reads and writes, you do not: the platform provides data adapters (Lightning Data Service) that work without server-side code. But for business logic, complex queries or integrations, you do call Apex from the component's JavaScript. In practice, real projects combine both: LWC handles the interface and the experience, and Apex handles the logic and server-side data access.

What files make up a Lightning Web Component?

Each component lives in a folder and groups at least three files: an HTML file with the template and data bindings, a JavaScript file with the class that handles state, events and logic, and an XML metadata file that defines where the component can be used. Optionally, you add CSS for styling and test files for automated testing.

What is LWC used for in a Salesforce project?

It is used to create custom experiences when Salesforce's standard components fall short: screens that combine data from several sources, forms specific to a process, custom panels or portals in Experience Cloud. It lets you go beyond standard configuration without sacrificing maintainability, because being based on web standards means more developers are trained in it and the knowledge carries over to other projects.

We bring this to your Salesforce

Salesforce implementation, integration and support for LatAm companies, focused on the team actually using it instead of going back to spreadsheets. Tell us where your org stands.

Keep exploring

Related terms

From the glossary

Related questions

We solve it with

Salesforce

Salesforce implementation, integration and support for LatAm companies, focused on real team adoption.

How Salesforce solves it
The full suite
Now that you know what it is, see how it gets solved

Five AI products that work on top of the CRM you already use. They don't replace your system: they add the layer you do by hand today.