> Documentation index: https://www.gooddata.ai/docs/gooddata-ui/llms.txt lists every page of these docs as Markdown.

# dashboardTabSwitched()

- Package: [@gooddata/sdk-ui-dashboard](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/index.md)
- Kind: function
- Stability: alpha
- Source: https://github.com/gooddata/gooddata-ui-sdk/blob/rel/11.64/libs/sdk-ui-dashboard/src/model/events/tabs.ts

> **Alpha API.** Initial API, highly likely to change outside SemVer. Don't build on it in production. See [API maturity](https://www.gooddata.ai/docs/gooddata-ui/latest/integrations/platform/api-maturity/index.md).
> 

Creates the DashboardTabSwitched event.

**Signature:**

```typescript
export declare function dashboardTabSwitched(ctx: DashboardContext, previousTabId: string | undefined, newTabId: string, correlationId?: string, source?: DashboardTabSwitchSource): IDashboardTabSwitched;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| ctx | [DashboardContext](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/sdk-ui-dashboard.dashboardcontext/index.md) | dashboard context |
| previousTabId | string \| undefined | identifier of the previously active tab |
| newTabId | string | identifier of the newly active tab |
| correlationId | string | _(Optional)_ correlation id to use for this event |
| source | [DashboardTabSwitchSource](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/sdk-ui-dashboard.dashboardtabswitchsource/index.md) | _(Optional)_ what triggered the switch; omit for a regular user-initiated tab switch. See [DashboardTabSwitchSource](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/sdk-ui-dashboard.dashboardtabswitchsource/index.md). |

**Returns:**

[IDashboardTabSwitched](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/sdk-ui-dashboard.idashboardtabswitched/index.md)

dashboard tab switched event
