lightning__UrlAddressable Target

Enables you to directly navigate to a component using a specific URL.

Syntax 

1<?xml version="1.0" encoding="UTF-8"?>
2<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
3  <apiVersion>61.0</apiVersion>
4  <isExposed>true</isExposed>
5  <targets>
6    <target>lightning__UrlAddressable</target>
7  </targets>
8</LightningComponentBundle>

targetConfigs 

lightning__UrlAddressable doesn’t accept properties within a XML tag. Instead, the component receives configuration and data when a user or code navigates to it using the standard__component page reference type.

The navigation attributes that determine the URL and passed data are:

PropertyTypeDescriptionRequired
componentNameStringThe component’s name in the format namespace__componentName (e.g., c__MyComponent). This attribute is required within the attributes object of the PageReference.Yes
stateObjectAn object containing key-value pairs that are serialized into URL query parameters to pass state information to the component. Keys must include a namespace (e.g., c__paramName). Values must be strings.No

Usage 

Use the lightning__UrlAddressable target to make your component accessible via a browser URL.

This target is supported only in the following types of projects. It’s not supported in Experience Builder sites.

  • Lightning Experience
  • Salesforce Mobile App
  • Custom apps, such as Lightning Console Apps

For examples of how to use lightning__UrlAddressable, check out Navigate to a URL-Addressable Component.

See Also