---
schema_version: "1"
id: 303bf73d75dc1114ee2fac56b203c6b0b0e0667658e3bd3639b5eb168b9ac010
title: LightningComponentBundle
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/api_meta/meta_lightningcomponentbundle.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_lightningcomponentbundle.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: ece244a238fddb72826705f546f14657d4c24d40eabddfef4f2abd45a8aa3ad0
description: Represents a Lightning web component bundle. A bundle contains Lightning web component resources.
---
# LightningComponentBundle

Represents a Lightning web component bundle. A bundle contains Lightning web component resources.

![Important](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/images/icon_note_important.png)

#### Important

Where possible, we changed noninclusive terms to align with our company value of Equality. We maintained certain terms to avoid any effect on customer implementations.

## Special Access Rules

LightningComponentBundle components can be created only in orgs with defined namespaces.

As of Summer ’20 and later, only your Salesforce org's internal users can access this type.

For more information on packaging a Lightning web component bundle, see the [Second-Generation Managed Packaging Developer Guide](https://developer.salesforce.com/docs/atlas.en-us.pkg2_dev.meta/pkg2_dev/packaging_packageable_components.htm#mdc_lightning_component).

## Fields

<table class="featureTable sort_table" summary="">



          <thead class="thead sorted" align="left">
            <tr>
              <th class="featureTableHeader  " id="d624501e82">Field Name</th>

              <th class="featureTableHeader  " id="d624501e85">Field Type</th>

              <th class="featureTableHeader  " id="d624501e88">Description</th>

            </tr>

          </thead>

          <tbody class="tbody">
            <tr>
              <td class="entry" headers="d624501e82" data-title="Field Name"><span class="keyword parmname">ai</span></td>

              <td class="entry" headers="d624501e85" data-title="Field Type">base64Binary</td>

              <td class="entry" headers="d624501e88" data-title="Description">An internal AI description of the Lightning web component. This description is
                supported only in orgs that have <a class="xref" href="https://help.salesforce.com/s/articleView?id=xcloud.setup_agentforce_overview.htm&amp;language=en_US" target="_blank">Setup with Agentforce</a> enabled. This
                description enables Agentforce to analyze the component for inclusion in
                agent-generated Lightning pages. For more information, see <a class="xref" href="https://developer.salesforce.com/docs/platform/lwc/guide/use-config-for-agentforce.html" target="_blank">Configure a Component for Use in Setup with
                  Agentforce</a>.<div class="codeSection xml">
                  <pre class="codeblock xml"><span class="tag">&lt;ai</span>&gt;
    <span class="tag">&lt;description</span>&gt;AI component description Example: The component enables users to add and style text content for dashboards, supporting features such as hyperlinks, bullet points, and text alignment. Ideal for adding formatted text sections such as instructions<span class="tag">&lt;/description</span>&gt;
    <span class="tag">&lt;property</span><span class="attribute"> name=</span>"prop1"<span class="attribute"> aiDescription=</span>"AI description for prop1"/&gt;
    <span class="tag">&lt;property</span><span class="attribute"> name=</span>"prop2"<span class="attribute"> aiDescription=</span>"AI description for prop2"/&gt;
<span class="tag">&lt;/ai</span>&gt;</pre>
                </div>
                <p class="p">Available in API version 66.0 and later.</p>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d624501e82" data-title="Field Name"><span class="keyword parmname">apiVersion</span></td>

              <td class="entry" headers="d624501e85" data-title="Field Type">double</td>

              <td class="entry" headers="d624501e88" data-title="Description">A double value that binds the component to a Salesforce API version.</td>

            </tr>

            <tr>
              <td class="entry" headers="d624501e82" data-title="Field Name"><span class="keyword parmname">capabilities</span></td>

              <td class="entry" headers="d624501e85" data-title="Field Type">
                <a class="xref" href="#capabilities">Capabilities</a>[]
              </td>

              <td class="entry" headers="d624501e88" data-title="Description">A list of capabilities. A capability is something that a component can do, as
                opposed to a target, which defines where you can use a component. Available in API
                version 48.0 and later.</td>

            </tr>

            <tr>
              <td class="entry" headers="d624501e82" data-title="Field Name"><span class="keyword parmname">description</span></td>

              <td class="entry" headers="d624501e85" data-title="Field Type">string</td>

              <td class="entry" headers="d624501e88" data-title="Description">A user-facing description of the Lightning web component. This description
                appears in list views, like the list of Lightning Components in Setup, and as a
                tooltip in the builders like Lightning App Builder and Experience Builder.</td>

            </tr>

            <tr>
              <td class="entry" headers="d624501e82" data-title="Field Name"><span class="keyword parmname">isExplicitImport</span></td>

              <td class="entry" headers="d624501e85" data-title="Field Type">boolean</td>

              <td class="entry" headers="d624501e88" data-title="Description"><span class="ph" id="isExplicit"><a name="isExplicit"><!-- --></a>Indicates whether imports between files are done explicitly
                  by the developer (<samp class="codeph nolang">true</samp>) or implicitly by the
                  framework (<samp class="codeph nolang">false</samp>).</span></td>

            </tr>

            <tr>
              <td class="entry" headers="d624501e82" data-title="Field Name"><span class="keyword parmname">isExposed</span></td>

              <td class="entry" headers="d624501e85" data-title="Field Type">boolean</td>

              <td class="entry" headers="d624501e88" data-title="Description"><span class="ph" id="isExposed"><a name="isExposed"><!-- --></a>If <samp class="codeph nolang">true</samp>, the component
                  is available to other namespaces. If <samp class="codeph nolang">true</samp> and
                  a <span class="keyword parmname">targets</span> value is also provided, the component is available
                  to Salesforce builders such as Lightning App Builder and Experience Builder. If
                  <samp class="codeph nolang">false</samp>, the component isn't available to
                  builders and other namespaces.</span></td>

            </tr>

            <tr>
              <td class="entry" headers="d624501e82" data-title="Field Name"><span class="keyword parmname">lwcResources</span></td>

              <td class="entry" headers="d624501e85" data-title="Field Type">
                <a class="xref" href="#lwcResources">LwcResources</a>[]
              </td>

              <td class="entry" headers="d624501e88" data-title="Description">A list of resources inside a bundle.</td>

            </tr>

            <tr>
              <td class="entry" headers="d624501e82" data-title="Field Name"><span class="keyword parmname">masterLabel</span></td>

              <td class="entry" headers="d624501e85" data-title="Field Type">string</td>

              <td class="entry" headers="d624501e88" data-title="Description">The component title that appears in the list view.</td>

            </tr>

            <tr>
              <td class="entry" headers="d624501e82" data-title="Field Name"><span class="keyword parmname">targetConfigs</span></td>

              <td class="entry" headers="d624501e85" data-title="Field Type">base64Binary</td>

              <td class="entry" headers="d624501e88" data-title="Description">Configurations for each target. Each target is a Lightning page type. For
                example, this configuration allows a Lightning web component to be used on a Contact
                record page in Lightning App
                Builder.<div class="codeSection xml">
                  <pre class="codeblock xml"><span class="tag">&lt;targetConfigs</span>&gt;
    <span class="tag">&lt;targetConfig</span><span class="attribute"> targets=</span>"lightning__RecordPage"&gt;
        <span class="tag">&lt;objects</span>&gt;
            <span class="tag">&lt;object</span>&gt;Contact<span class="tag">&lt;/object</span>&gt;
        <span class="tag">&lt;/objects</span>&gt;
    <span class="tag">&lt;/targetConfig</span>&gt;
<span class="tag">&lt;/targetConfigs</span>&gt;</pre>
                </div>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d624501e82" data-title="Field Name"><span class="keyword parmname">targets</span></td>

              <td class="entry" headers="d624501e85" data-title="Field Type">
                <a class="xref" href="#targets">Targets</a>[]
              </td>

              <td class="entry" headers="d624501e88" data-title="Description">A list of targets where the Lightning web component can be used, such as in
                Lightning App Builder or Experience Builder sites.</td>

            </tr>

          </tbody>

        </table>

## Capabilities

Represents a list of capabilities. A capability is something that a component can do, as opposed to a target, which defines where you can use a component. Available in API version 48.0 and later. For more information, see [XML Configuration File Elements](https://developer.salesforce.com/docs/platform/lwc/guide/reference-configuration-tags.html).

<table class="featureTable sort_table" summary="">



          <thead class="thead sorted" align="left">
            <tr>
              <th class="featureTableHeader  " id="d624501e300">Field</th>

              <th class="featureTableHeader  " id="d624501e303">Field Type</th>

              <th class="featureTableHeader  " id="d624501e306">Description</th>

            </tr>

          </thead>

          <tbody class="tbody">
            <tr>
              <td class="entry" headers="d624501e300" data-title="Field"><span class="keyword parmname">capability</span></td>

              <td class="entry" headers="d624501e303" data-title="Field Type">string</td>

              <td class="entry" headers="d624501e306" data-title="Description">Specifies something that a component can do. Valid values are:<ul class="ul bulletList">
                  <li class="li"><samp class="codeph xml">lightningCommunity__RelaxedCSP</samp></li>

                  <li class="li"><samp class="codeph xml">lightning__dynamicComponent</samp></li>

                  <li class="li"><samp class="codeph xml">lightning__ServerRenderable</samp></li>

                  <li class="li"><samp class="codeph xml">lightning__ServerRenderableWithHydration</samp></li>

                  <li class="li"><samp class="codeph xml">lightning__ServiceCloudVoiceToolkitApi</samp></li>

                </ul>
              </td>

            </tr>

          </tbody>

        </table>

## LwcResources

Represents a list of resources inside a LightningComponentBundle.

| Field | Field Type | Description |
| --- | --- | --- |
| lwcResource | [LwcResource](#lwcResource) | A resource inside a LightningComponentBundle. |

## LwcResource

Represents a resource inside a LightningComponentBundle.

| Field | Field Type | Description |
| --- | --- | --- |
| filePath | string | Required. The file path of a resource. |
| source | base64Binary | Required. The content of a resource. |

## Targets

Represents a list of supported containers for a Lightning web component. For more information, see [XML Configuration File Elements](https://developer.salesforce.com/docs/platform/lwc/guide/reference-configuration-tags.html).

<table class="featureTable sort_table" summary="">



          <thead class="thead sorted" align="left">
            <tr>
              <th class="featureTableHeader  " id="d624501e501">Field</th>

              <th class="featureTableHeader  " id="d624501e504">Field Type</th>

              <th class="featureTableHeader  " id="d624501e507">Description</th>

            </tr>

          </thead>

          <tbody class="tbody">
            <tr>
              <td class="entry" headers="d624501e501" data-title="Field"><span class="keyword parmname">target</span></td>

              <td class="entry" headers="d624501e504" data-title="Field Type">string</td>

              <td class="entry" headers="d624501e507" data-title="Description">Specifies the type of Lightning page the component can be added to in the
                builders, such as in Lightning App Builder, Experience Builder, Flow Builder, or
                Document Builder.<p class="p">For valid values, see <a class="xref" href="https://developer.salesforce.com/docs/platform/lwc/guide/reference-configuration-tags.html#target" target="_blank">XML Configuration File Elements:
                    target</a>.</p>
              </td>

            </tr>

          </tbody>

        </table>

## Declarative Metadata Sample Definition

This package.xml file retrieves all the LightningComponentBundle components in an org.

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types\>
        <members\>\*</members\>
        <name\>LightningComponentBundle</name\>
    </types\>
    <version\>45.0</version\>
</Package\>

In the retrieved zip file, each Lightning web component is nested under an lwc folder.

This example shows the directory structure in the zip file of one component with a name of hello.

lwc
    hello
        hello.html
        hello.js
        hello.js-meta.xml

Here are the contents of the files in the hello directory.

Content of hello.html:

<template\>

    <lightning-card title="Hello" icon-name="custom:custom14"\>
        <div class="slds-m-around\_medium"\>
            Hello, {greeting}!
        </div\>
    </lightning-card\>

</template\>

Content of hello.js:

import { LightningElement } from 'lwc';

export default class Hello extends LightningElement {
    greeting = 'World';
}

Content of hello.js-meta.xml.

<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion\>45.0</apiVersion\>
    <isExposed\>true</isExposed\>
    <targets\>
        <target\>lightning\_\_AppPage</target\>
        <target\>lightning\_\_RecordPage</target\>
        <target\>lightning\_\_HomePage</target\>
    </targets\>
</LightningComponentBundle\>

## Wildcard Support in the Manifest File

This metadata type supports the wildcard character \* (asterisk) in the package.xml manifest file. For information about using the manifest file, see [Deploying and Retrieving Metadata with the Zip File](https://developer.salesforce.com/docs/atlas.en-us.264.0.api_meta.meta/api_meta/file_based_zip_file.htm).