I am creating a LWC Component, in the xml metadata file i have added the <masterlable> tag to give a title of the component, i am trying to add <description> so that when i navigate to Setup-->Lightning components in the view i can see the component name, label and Description. But the description i am using in the .xml metadata file is not appearing here, any reason why its not ? and is there any alternate to make it appear in the view? please help.
#Trailhead Challenges
Hi, @Murugavel K
Yes, in Lightning Web Components (LWC), you can add a description to a component, but there are nuances regarding how it works and is displayed in the Salesforce interface.
In the metadata of an LWC (.js-meta.xml file), you can add the <description> tag to describe the component. This tag is officially supported in the LWC specification and is intended to provide additional information about the component. Here is an example of the correct syntax:
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>59.0</apiVersion>
<isExposed>true</isExposed>
<masterLabel>My LWC Component</masterLabel>
<description>This is a custom LWC component for displaying account details.</description>
<targets>
<target>lightning__AppPage</target>
</targets>
</LightningComponentBundle>
Unfortunately, as of today (February 2025), the Description field for LWC does not appear in the standard Setup > Lightning Components
interface, even if you specify it in the .js-meta.xml file. This is a limitation of the Salesforce UI, not an issue with your code. Salesforce simply does not display the <description> value in this specific view, although it is stored in the component’s metadata.
This differs from Aura components, where the description (specified via <aura:component description="...">) sometimes appears in the UI. For LWC, there is currently no such direct display in Setup
.
Sincerely,
Mykhailo Vdovychenko
Bringing Cloud Excellence with IBVCLOUD OÜ