lightning__RecordAction Target

Enables a component to be used as a quick action on a record page. To specify the type of quick action, define a targetConfig with an actionType attribute.

Configures the component for a record action and defines component properties. The targetConfigs tag contains at least one targetConfig tag.

Configures a page type with this attribute.

AttributeDescriptionRequired
targetsSpecify one or more page types in the targets attribute, such as <targetConfig targets="lightning__RecordAction"> or <targetConfig targets="lightning__RecordAction,lightning__RecordPage">. The targets attribute value must match one or more of the page types that you listed under <targets>.Yes
actionTypeSpecify the type of Lightning web component quick action. Valid values are:
  • ScreenAction—(Default) Runs custom code in a modal window
  • Action—Runs custom code without opening a modal window
See Configure a Component for Quick Actions.

lightning__RecordAction doesn't support component properties.

A set of one or more form factors or devices that the component supports. Specify the supportedFormFactors tag set one time inside a targetConfig set. The supportedFormFactors tag contains at least one supportedFormFactors tag.

Defines which form factor or device the component supports. Use one supportedFormFactor tag for each supported form factor.

The supportedFormFactor tag supports this attribute.

AttributeTypeDescriptionRequired
typeStringDevice form factor on which the component displays. Valid values are:
  • Large—Represents the desktop form factor.
  • Small—Represents the phone form factor.
Yes

We strongly recommend including supported form factor information in the configuration file. See Configure Your Component for Different Form Factors.

You can use a quick action to navigate to an object page, such as the Contact home page. In this example, a headless quick action executes custom code you provide in an @api invoke() method.

A headless quick action corresponds to the Action type.

You can't change the action type after you've defined it in the configuration file. For example, you can't change a component's action type from Action to ScreenAction or vice versa after you deploy your component.

Creating an LWC action in Lightning Experience is similar to creating a regular quick action. For more information, see Salesforce Help: Lightning Web Component Actions. If you're creating a LWC action for the Field Service mobile app, see Salesforce Help: Create Quick Actions for the Field Service Mobile App.

To enable a component to be used as a global quick action, use lightning__GlobalAction instead.

See Also