Configure a Component for Quick Actions

To use a Lightning web component as a quick action, define the component’s metadata.

There are two types of LWC quick actions: screen quick actions and headless quick actions.

You can use a Lightning web component as a quick action on record pages only. You can’t use a Lightning web component as a global quick action.

A component’s project folder must include a componentName.js-meta.xml configuration file that defines the metadata values for the component. To use a component as a quick action, configure the file with these steps.

  1. In targets, add lightning__RecordAction as a target to designate the Lightning web component as a quick action on a record page.
  2. Add a targetConfig and set targets to lightning__RecordAction.
  3. Set actionType to ScreenAction or Action to choose the quick action type. If you don’t specify actionType, the quick action defaults to a screen action.

This configuration file defines a screen action.

This configuration file defines a headless action.

See the complete list of XML Configuration File Elements.

In Salesforce Setup, create object-specific actions via the Object Manager page. Then add the action to the Salesforce Mobile and Lightning Experience Actions section of your page layout. See Quick Actions in Salesforce Help.

Using a Lightning web component as a quick action isn’t supported in the Salesforce mobile app.

See Also