Newer Version Available
setTabLabel() for Lightning Experience
Sets the label of the specified tab. This method works only in
Lightning console apps.
Arguments
| Name | Type | Description |
|---|---|---|
| tabId | string | The ID of the tab for which to set the label. |
| label | string | The label of the workspace tab or subtab. |
Sample Code
This component has a button that, when pressed, sets the label of the focused tab to “Focused Tab”.
Component code:
Controller code:
Response
This method returns a promise that, upon success, resolves to a
tabInfo object representing the modified tab. A
tabInfo object is a JSON array of
information about a workspace tab, with nested arrays of information on each subtab.
This is the structure of a tabInfo
object.