Each LWC folder must include a configuration file named <component>.js-meta.xml
. This file defines the metadata values for the component, including the design configuration for components intended for use in Lightning App Builder as:
<aside>
🔥 A custom LWC can’t access another LWC or module in a custom namespace. It can access Lightning web components and modules only in the c
and lightning
namespaces.
</aside>
apiVersion
: A double value that binds the component to a Salesforce API version.
description
: A brief description of the component, usually a single sentence. Appears in list views, like the list of Lightning Components in Setup, and as a tooltip in the Lightning App Builder and in Community Builder.
masterLabel
: The title of the component. Appears in list views, like the list of Lightning Components in Setup, and in the Lightning App Builder and in Community Builder.
isExposed
: to allow the component to be used in Lightning App Builder or Community Builder, set isExposed
to true
and define at least one <target>
, which is a type of Lightning page.
targets
: specifies where the component can be added, such as on a type of Lightning Page or in Embedded Service Chat. If you want your component to appear in the Lightning App Builder or in Community Builder, specify at least one Lightning page type. Valid values are:
targetConfigs
: configure the component for different page types and define component properties. For example, a component could have different properties on a record home page than on the Salesforce Home page or on an app page. For Communities, only lightningCommunity__Default
supports component properties. Use a separate targetConfig
for each different page type configuration. Specify one or more page types in the targets
attribute, such as <targetConfig targets="lightning__RecordPage">
or <targetConfig targets="lightning__RecordPage,lightning__AppPage">
.
The targets
attribute value must match one or more of the page types that you listed under <targets>
. Supports the property
, objects
, and supportedFormFactors
subtags.
objects:
a set of one or more objects the component is supported for. This tag set works only inside a parent targetConfig
that’s configured for lightning__RecordPage
. Specify the objects
tag set only once inside a targetConfig
set. Supports the object
subtag. **object
**Defines which objects the component is supported for. Use one object
tag for each supported object. You can’t use ‘*
’ to denote all objects.See the User Interface API Developer Guide for the list of supported objects.