Add Lightning Web Component to Lightning Tab
From Winter 20 release you are able to set it as Tab. All you need to do is:
- Open
-meta.xml
file from your LWC component - Change is exposed to True:
<isExposed>true</isExposed>
- Add
<target>lightning__Tab</target>
- Open Tab from setup and under Lightning Component Tabs press New and select your LWC component.
Your file at the end should look like this:
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>47.0</apiVersion>
<isExposed>true</isExposed>
<targets>
<target>lightning__Tab</target>
</targets>
</LightningComponentBundle>
As stated in comments, My Domain
is a prerequisite to Lightning Component Tabs
With Winter 20 release, we can create the Lightning Tab using LWC component. You will just have to add the below tag in the -meta.xml
file of LWC component.
<target>lightning__Tab</target>