---
schema_version: "1"
id: 38ee7a621f77ba71afbaf140e8cfa9014d85d674480920c0a5f861aab89c9293
title: Tab Created
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/lightning-base-components/lightning-design-system/guides/aura/components/lightning/tabCreated/aura-tab-created.md
canonical_url: https://developer.salesforce.com/docs/platform/lightning-component-reference/guide/aura-tab-created.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: dbca46d1146bf17255e91a1b3740f778e9b91b63caf5de677488770c2658f98b
products:
  - Lightning Component Reference
---
# Tab Created

**`lightning:tabCreated`**

Fires when a Console workspace or subtab has been successfully created.

**For Use In**

Lightning Experience

::::::tabset{tabs='[ "Develop", "Specifications"]'}

:::::tab

`lightning:tabCreated` is an application event that indicates a tab has been created successfully. This event is supported in Lightning console apps only.

Handle the event using `aura:handler`.

```html
<aura:component implements="flexipage:availableForAllPageTypes" access="global">
  <lightning:workspaceAPI aura:id="workspace" />
  <aura:handler event="lightning:tabCreated" action="{! c.onTabCreated }" />
</aura:component>
```

In your client-side controller, retrieve the ID of the new tab and set a label on the tab.

```javascript
({
  onTabCreated: function (component, event, helper) {
    var newTabId = event.getParam("tabId");
    var workspace = component.find("workspace");
    workspace.setTabLabel({
      tabId: newTabId,
      label: "New Tab",
    });
  },
});
```

For more information, see the [Salesforce Console Developer Guide](https://developer.salesforce.com/docs/atlas.en-us.api_console.meta/api_console/).


:::::

:::::tab
## Attributes

| Name    | Description               | Type   | Default | Required                                     |
| ------- | ------------------------- | ------ | ------- | -------------------------------------------- |
| `tabId` | The newly created tab ID. | string |         | ![Yes](https://developer.salesforce.com/media/check.png) |

:::::

::::::
