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‑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.
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
‑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).
Examples for template generate ui-embedding
Generate an embedding wrapper LWC in the current directory: