4

How do I give my lightning web component a better name than simply 'helloWorld' or 'createNewCase' in the Custom section of the Lightning App Builder when published? I want something like 'Hello World' and 'Create New Case' (Non-camel case capitalization with spaces).

Note: I tried changing the LightningComponentBundle tag fqn value, but that did not change the name in the UI.

7

Use the masterLabel tag in the configuration XML file.

<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="firstComponent">
  <apiVersion>45.0</apiVersion>
  <isExposed>true</isExposed>
  <targets>
    <target>lightning__AppPage</target>
    <target>lightning__RecordPage</target>
    <target>lightning__HomePage</target>
  </targets>
    <masterLabel>First Component</masterLabel>
  <targetConfigs>
    <targetConfig targets="lightning__RecordPage,lightning__AppPage,lightning__HomePage">
      <property name="label" type="String" default="WIPDeveloper.com"></property>
    </targetConfig>
  </targetConfigs>
</LightningComponentBundle>

Results in the following in setup.

enter image description here

Ref: https://fun-inspiration-5789-dev-ed.lightning.force.com/docs/component-library/documentation/lwc/lwc.reference_configuration_tags

4

Use the master label tag in meta XML like below

<?xml version="1.0" encoding="UTF-8"?>
 <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="parentCmp">
 <apiVersion>46.0</apiVersion>
 <isExposed>true</isExposed>
 <masterLabel> Test Component </masterLabel>
 <targets>
    <target>lightning__HomePage</target>
 </targets>
</LightningComponentBundle>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.