On this page, we’ll walk through how to set up a Lightning web component to perform a quick action on a record page. This process has two parts: updating the component’s XML metadata and creating a quick action in Salesforce Setup.
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.
Note
Define Component Metadata in its Configuration File
Your component’s project folder must include a componentName.js-meta.xml configuration file that defines the component’s metadata. To use the component as a quick action, update the file as follows.
In the targets section, add lightning__RecordAction as a target to define the Lightning web component as a quick action on a record page.
Add a targetConfig and set targets to lightning__RecordAction.
To define the quick action type, set actionType to ScreenAction for a screen quick action or Action for a headless quick action. If you don’t specify actionType, the quick action defaults to a screen action.
You can’t change the action type after you’ve defined it in your Lightning web component. For example, a component’s action type can’t be changed from Action to ScreenAction or vice versa.