# summary

Generate a UI bundle, which contains the code and metadata to build a UI experience that uses non-native Salesforce frameworks, such as React or Angular.

# description

Salesforce provides native UI frameworks, such as Lighting Web Components (LWC), to build applications that run on the Salesforce Platform. But you can also use non-native JavaScript- or TypeScript-based UI frameworks, such as React, to build a UI experience for the Salesforce Platform and that you can launch from the App Launcher.

These non-native UI experiences are defined by the "UIBundle" metadata type in your DX project. Use this command to generate the required DX project structure and files. For example, when you run this command and specify the name MyUiBundle, then the files are generated into a "uiBundles/MyUiBundle" directory. Use the --output-dir flag to specify a different directory.

Use the --template flag for generating the files to get started with a specific UI framework, such as React or Angular. Check out the README.md file in the generated "uiBundles/<bundlename>" directory for more information about the template.

# examples

- Generate a UI bundle called MyUiBundle in the current directory:

  <%= config.bin %> <%= command.id %> --name MyUiBundle

- Generate a React-based UI bundle:

  <%= config.bin %> <%= command.id %> --name MyReactApp --template reactbasic

- Generate an Angular-based UI bundle:

  <%= config.bin %> <%= command.id %> --name MyAngularApp --template angularbasic

- Generate the React-based UI bundle in the "force-app/main/default/uiBundles" directory:

  <%= config.bin %> <%= command.id %> --name MyUiBundle --template reactbasic --output-dir force-app/main/default/uiBundles

# flags.name.summary

API name of the generated UI bundle.

# flags.name.description

This name can contain only underscores and alphanumeric characters, and must be unique in your org. It must begin with a letter, not include spaces, not end with an underscore, and not contain two consecutive underscores.

# flags.template.summary

Template to use when creating the files for a specific UI framework.

# flags.template.description

Supplied parameter values or default values are filled into a copy of the template.

# flags.label.summary

Master label for the UI bundle.

# flags.label.description

If not specified, the label is derived from the name.

# flags.output-dir.summary

Directory into which the files are created.

# flags.output-dir.description

The location can be an absolute path or relative to the current working directory.

If not specified, the command reads your sfdx-project.json and defaults to "uiBundles" directory within your default package directory. When running outside a Salesforce DX project, defaults to the current directory.

**Important:** This command automatically ensures the output directory ends with "uiBundles". If your specified path doesn't end with "uiBundles", it's automatically appended. The UI bundle is created at "<output-dir>/<name>".

**Examples:**

- "--output-dir force-app/main/default" → Creates a UI bundle at "force-app/main/default/uiBundles/MyUiBundle/"
- "--output-dir force-app/main/default/uiBundles" → Creates a UI bundle at "force-app/main/default/uiBundles/MyUiBundle/" (no change)
