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:
| Aspect | Lightning Web Components | Aura |
|---|---|---|
| Technology base | Native web standards | Proprietary framework |
| Performance | Lighter and faster | Heavier |
| Learning curve | Close to modern JavaScript | Its own syntax to learn |
| Status in Salesforce | Recommended for everything new | Supported, in legacy mode |
| Interoperability | Runs inside Aura components | Does 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.
FAQs about Lightning Web Components
What is 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?
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?
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?
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?
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.
Related terms
- ApexApex is Salesforce's proprietary, object-oriented programming language, similar to Java, that runs on Salesforce's servers. It lets you add custom business logic (triggers, classes and integrations) when declarative tools such as Flow are not enough.
- Governor LimitsGovernor limits are the execution limits Salesforce imposes on each transaction (queries, records processed, API calls, CPU) to protect the shared resources of its multi-tenant architecture, where many customers run on the same infrastructure.
- Salesforce ObjectA Salesforce object is a database table that stores one type of record (accounts, contacts, opportunities). It defines the fields, relationships and rules of a set of business data inside the platform.
- Salesforce SandboxA Salesforce sandbox is an isolated copy of your production org where you can develop, configure and test changes without affecting real users or live data, before promoting those changes to production in a controlled way.
- MiddlewareMiddleware is software that acts as a bridge between two or more systems, translating, orchestrating and routing data so that different applications (for example an ERP and a CRM) can communicate without connecting directly.
- Multi-TenancyMulti-tenancy is a cloud software architecture in which a single instance of an application serves many customers (tenants) at once, with each one's data logically isolated. It is the foundational model of SaaS and of Salesforce.
Related questions
Salesforce
Salesforce implementation, integration and support for LatAm companies, focused on real team adoption.
How Salesforce solves itFive 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.





