Custom Tab For Lightning Web Components

The post explains the process of using a Lightning Web Component (LWC) in a custom tab in both the Salesforce mobile app and Lightning Experience. This is possible since Winter '20 release by setting "isExposed" to TRUE in the metadata file and adding "lightning__Tab" to target to enable the LWC in the Custom Lightning Component Tab.

We can use the lightning web component in the custom tab( in lightning experience and salesforce mobile app) with the winter 20 release.

If you have created a lighting web component you know that there is a configuration file that represents the metadata values for the component. To allow the lighting web component to be used in the lightning app builder we need to set “isExposed” to TRUE. Adding “lightning__Tab” to target will allow using lwc in the custom lighting component tab.

<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata&quot; fqn="HelloCustomer">
<apiVersion>47.0</apiVersion>
<isExposed>true</isExposed>
<targets>
<target>lightning__AppPage</target>
<target>lightning__RecordPage</target>
<target>lightning__HomePage</target>
<target>lightning__Tab</target>
</targets>
</LightningComponentBundle>

Goto -> Setup -> Quick Find -> search “tab” -> click on tab

Click on “New” button
Select your lightning web component
Arun Kumar
Arun Kumar

Arun Kumar is a Salesforce Certified Platform Developer I with over 7+ years of experience working on the Salesforce platform. He specializes in developing custom applications, integrations, and reports to help customers streamline their business processes. Arun is passionate about helping businesses leverage the power of Salesforce to achieve their goals.

Articles: 162

Leave a Reply

Discover more from SFDC Lessons

Subscribe now to keep reading and get access to the full archive.

Continue reading

Discover more from SFDC Lessons

Subscribe now to keep reading and get access to the full archive.

Continue reading