template generate ui-embedding

Generate a Lightning Web Component (LWC) bundle that wraps the <lightning-ui-embedding> base component.

Description for template generate ui-embedding 

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”.

Flags 

Flag Name (Long)Flag Name (Short)Description
‑‑api‑versionN/AType: Value

Override the api version used for api requests made by this command
‑‑flags‑dirN/AType: Value

Import flag values from a directory.
‑‑jsonN/AType: Boolean

Format output as json.
‑‑name‑nType: 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‑dType: 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.
‑‑sandboxN/AType: 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-activation

Iframe 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‑sType: 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).
‑‑titleN/AType: 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).

Examples for template generate ui-embedding 

Generate an embedding wrapper LWC in the current directory:

1sf template generate ui-embedding --name MyEmbeddingWrapper --src https://app.example.com --sandbox allow-forms --title "Expense Report Embedding"

Generate an embedding wrapper LWC in the “force-app/main/default/lwc” directory with multiple sandbox tokens:

1sf template generate ui-embedding --name MyEmbeddingWrapper --src https://app.example.com --sandbox allow-forms --sandbox allow-scripts --title "Expense Report Embedding" --output-dir force-app/main/default/lwc