template generate ui-embedding
Generate a Lightning Web Component (LWC) bundle that wraps the <lightning-ui-embedding> base component.
The generated LWC bundle consumes the first-party <lightning-ui-embedding> component, which is pre-wired with the three required attributes: the embedding URL (–src), iframe sandbox tokens, and an accessible iframe title (–title).
The generated LWC bundle contains four files (.html, .js, .js-meta.xml, .css) in a directory named with the camelCased component name. The bundle must live under a parent folder named “lwc”.
| Flag Name (Long) | Flag Name (Short) | Description |
|---|---|---|
‑‑api‑version | N/A | Type: Value Override the api version used for api requests made by this command |
‑‑flags‑dir | N/A | Type: Value Import flag values from a directory. |
‑‑json | N/A | Type: Boolean Format output as json. |
‑‑name | ‑n | Type: Value Required Name of the generated component; must be in PascalCase format. The component name is also used (camelCased) as the LWC folder name and file stem. Must contain only alphanumeric characters and start with a letter. |
‑‑output‑dir | ‑d | Type: Value Default value: .Directory for saving the created files. The location can be an absolute path or relative to the current working directory. The default is the current directory. |
‑‑sandbox | N/A | Type: Value Required Valid Values: allow-forms, allow-modals, allow-orientation-lock, allow-pointer-lock, allow-popups, allow-popups-to-escape-sandbox, allow-presentation, allow-same-origin, allow-scripts, allow-storage-access-by-user-activation, allow-top-navigation, allow-top-navigation-by-user-activationIframe sandbox token. Specify this flag multiple times to set more than one token. Each token is written into the space-separated “sandbox” attribute on <lightning-ui-embedding>. Only W3C-defined sandbox tokens are accepted. |
‑‑src | ‑s | Type: Value Required Absolute HTTPS URL that the iframe will load. The URL is bound to the <lightning-ui-embedding> “src” attribute as a reactive property in the generated LWC. Must use HTTPS; plain HTTP is allowed only for localhost or 127.0.0.1 (for local development). |
‑‑title | N/A | Type: Value Required Accessible title for the embedded iframe. Written to the “shell-title” attribute on <lightning-ui-embedding> and used as the iframe’s accessible name (announced by screen readers). |
Generate an embedding wrapper LWC in the current directory:
Generate an embedding wrapper LWC in the “force-app/main/default/lwc” directory with multiple sandbox tokens: