# schema generate tab

Generate the metadata source files for a new custom tab on a custom object.

## Description for schema generate tab

Custom tabs let you display custom object data or other web content in Salesforce. Custom tabs appear in Salesforce as an item in the app’s navigation bar and in the App Launcher.

This command must be run in a Salesforce DX project directory. You must pass all required information to it with the required flags. The source files for the custom object for which you're generating a tab don't need to exist in your local project.

## Aliases for schema generate tab

`generate:metadata:tab`

## Flags

| Flag Name (Long) | Flag Name (Short) | Description                                                                                                                                                                                                                              |
| ---------------- | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--directory`    | `-d`              | **Type:** Value<br>**Required**<br><br>Path to a "tabs" directory that will contain the source files for your new tab.                                                                                                                   |
| `--flags-dir`    | N/A               | **Type:** Value<br><br>Import flag values from a directory.                                                                                                                                                                              |
| `--icon`         | `-i`              | **Type:** Value<br>**Required**<br>**Default value:** `1`<br><br>Number from 1 to 100 that specifies the color scheme and icon for the custom tab.<br><br>See <https://lightningdesignsystem.com/icons/#custom> for the available icons. |
| `--json`         | N/A               | **Type:** Boolean<br><br>Format output as json.                                                                                                                                                                                          |
| `--object`       | `-o`              | **Type:** Value<br>**Required**<br><br>API name of the custom object you're generating a tab for.<br><br>The API name for a custom object always ends in `__c`, such as `MyObject__c`.                                                   |

## Examples for schema generate tab

Create a tab on the `MyObject__c` custom object:

```shell
sf schema generate tab --object `MyObject__c` --icon 54 --directory force-app/main/default/tabs
```
