A Lightning Web Component (LWC) is a custom HTML element built on the Web Components standards — <template>, custom elements, Shadow DOM, ES modules — plus a thin Salesforce layer for data binding, decorators, and platform services. Each component is a folder of three files: an HTML template, a JavaScript controller, and an XML configuration file.
A minimum-viable component
<!-- helloWorld.html -->
<template>
<p>Hello, {name}!</p>
</template>
// helloWorld.js
import { LightningElement } from 'lwc';
export default class HelloWorld extends LightningElement {
name = 'CRM Curator';
}
<!-- helloWorld.js-meta.xml -->
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>62.0</apiVersion>
<isExposed>true</isExposed>
<targets>
<target>lightning__RecordPage</target>
<target>lightning__AppPage</target>
</targets>
</LightningComponentBundle>
Three things to notice:
- Plain JavaScript classes. No proprietary DSL, no
aura:attributeXML — just ES2015+ classes extendingLightningElement. - Reactive bindings.
{name}re-renders automatically when the field changes. NosetStatecall needed. - The XML descriptor decides where the component can be dropped.
isExposedplus a<targets>list determine whether admins see it in App Builder, Experience Builder, Flow Screens, or utility bars.
Why Salesforce moved off Aura
Aura predated the Web Components standard. By 2018 the browser had caught up: every evergreen browser supported custom elements, Shadow DOM, and ES modules natively. Salesforce rewrote the UI framework on those standards so that:
- Performance — less framework code shipped over the wire, native DOM operations instead of Aura’s virtual DOM diffing.
- Skills transferability — anyone who knows modern JavaScript and Web Components is 80% of the way to writing LWC.
- Future-proofing — when the browser improves, LWC inherits it for free.
What you get for free
- Shadow DOM scoping — your component’s CSS doesn’t leak out and outside CSS doesn’t bleed in.
- Lightning Data Service integration via
lightning/uiRecordApi— no Apex needed for record CRUD. - Wire adapters for declarative, cached data fetching.
- Built-in security — Lightning Web Security (LWS) sandboxes each namespace.
- Base components — Salesforce ships ~150 production-grade components under
lightning-(datatable, input, card, modal, …).
Where you can use LWC
Inside Salesforce: Experience Cloud sites, Lightning App Builder pages, Flow screens, utility bars, quick actions, Mobile, Lightning Out (embedded in Visualforce or external apps). Outside Salesforce: LWC OSS — the open-source version that runs anywhere you can serve a static file.
What interviewers are really looking for
They want to know whether you understand that LWC is standards-first, not framework-first. If you can explain why Salesforce dropped Aura’s proprietary model in favour of native Web Components — performance, skill portability, browser-native primitives — you’ve shown the conceptual understanding that matters.
Verified against: LWC Developer Guide — Introduction, Trailhead trail Build Lightning Web Components. Last reviewed 2026-05-17 for Spring ‘26 release.