I am trying to figure out how to add a Lightning Web Component to a Lightning tab. I have it on the Home Page, but I would like it to be on its own tab. I feel like there should be an option to expose it to the Lightning tabs. When I am in the Tabs section, I don't see my LWC listed.
From Winter 20 release you are able to set it as Tab. All you need to do is:
-meta.xmlfile from your LWC component
- Change is exposed to True:
- 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
I was facing the same problem, after tried various solutions, I noticed in Setup -> Tabs is a link for help: https://help.salesforce.com/articleView?id=dev_tabdef.htm&type=5, there say for see Lightning Component Tabs you need a deployed my domain:
NOTE To expose Lightning components via Lightning component tabs, you must enable and deploy My Domain.
I deployed My Domain in Setup-> My Domain and then in tabs appears the option Lightning Component Tabs