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

# IDashboardLoader

- Package: [@gooddata/sdk-ui-loaders](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-loaders/index.md)
- Kind: interface
- Source: https://github.com/gooddata/gooddata-ui-sdk/blob/rel/11.64/libs/sdk-ui-loaders/src/dashboard/loader.ts

Dashboard loader is responsible for loading dashboard and all the assets that the dashboard needs. As a result, it returns a React component and an instance of props to use in order to mount the dashboard.

**Signature:**

```typescript
export interface IDashboardLoader 
```

## Methods

| Method | Description |
| --- | --- |
| [forDashboard(dashboardRef)](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-loaders/sdk-ui-loaders.idashboardloader/index.md#idashboardloaderfordashboard) | Specify dashboard to load. |
| [fromClientWorkspace(clientWorkspace)](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-loaders/sdk-ui-loaders.idashboardloader/index.md#idashboardloaderfromclientworkspace) | Alternatively specify workspace indirectly, using data product, segment and client identifier. |
| [fromWorkspace(workspace)](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-loaders/sdk-ui-loaders.idashboardloader/index.md#idashboardloaderfromworkspace) | Specify identifier of workspace where the dashboard is stored. |
| [load(options)](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-loaders/sdk-ui-loaders.idashboardloader/index.md#idashboardloaderload) | Load the dashboard, dashboard engine and plugins that should be on the dashboard. |
| [onBackend(backend)](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-loaders/sdk-ui-loaders.idashboardloader/index.md#idashboardloaderonbackend) | Specify an instance of Analytical Backend that hosts the dashboards. |
| [withBaseProps(props)](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-loaders/sdk-ui-loaders.idashboardloader/index.md#idashboardloaderwithbaseprops) | Specify an instance of [IDashboardBaseProps](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/sdk-ui-dashboard.idashboardbaseprops/index.md) to use for the dashboard component. |
| [withEmbeddedPlugins(plugins)](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-loaders/sdk-ui-loaders.idashboardloader/index.md#idashboardloaderwithembeddedplugins) | Specify embedded plugins to use on top of any plugins that the dashboard is already configured to use. |
| [withFilterContext(filterContextRef)](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-loaders/sdk-ui-loaders.idashboardloader/index.md#idashboardloaderwithfiltercontext) | Override filter context to use for the loaded dashboard. |

## Method details

### IDashboardLoader.forDashboard()

Specify dashboard to load.

**Signature:**

```typescript
forDashboard(dashboardRef: ObjRef): IDashboardLoader;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| dashboardRef | [ObjRef](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.objref/index.md) | reference to an existing dashboard. |

**Returns:**

[IDashboardLoader](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-loaders/sdk-ui-loaders.idashboardloader/index.md)

### IDashboardLoader.fromClientWorkspace()

Alternatively specify workspace indirectly, using data product, segment and client identifier.

**Signature:**

```typescript
fromClientWorkspace(clientWorkspace: IClientWorkspaceIdentifiers): IDashboardLoader;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| clientWorkspace | [IClientWorkspaceIdentifiers](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui/sdk-ui.iclientworkspaceidentifiers/index.md) | complex identifier of the client workspace |

**Returns:**

[IDashboardLoader](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-loaders/sdk-ui-loaders.idashboardloader/index.md)

#### Remarks

Note: this indirect method of identification was only supported by the Life Cycle Management features of the retired legacy platform; current backends do not support it.

### IDashboardLoader.fromWorkspace()

Specify identifier of workspace where the dashboard is stored.

**Signature:**

```typescript
fromWorkspace(workspace: string): IDashboardLoader;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| workspace | string | identifier of workspace |

**Returns:**

[IDashboardLoader](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-loaders/sdk-ui-loaders.idashboardloader/index.md)

### IDashboardLoader.load()

Load the dashboard, dashboard engine and plugins that should be on the dashboard.

**Signature:**

```typescript
load(options?: IDashboardLoadOptions): Promise<DashboardLoadResult>;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| options | [IDashboardLoadOptions](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-loaders/sdk-ui-loaders.idashboardloadoptions/index.md) | _(Optional)_ |

**Returns:**

Promise&lt;[DashboardLoadResult](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-loaders/sdk-ui-loaders.dashboardloadresult/index.md)&gt;

#### Remarks

Then performs the initialization of the plugins and their registration.

Finally, returns result containing the DashboardComponent to render, it's props and details about the plugins that will be in effect once the DashboardComponent gets mounted.

### IDashboardLoader.onBackend()

Specify an instance of Analytical Backend that hosts the dashboards.

**Signature:**

```typescript
onBackend(backend: IAnalyticalBackend): IDashboardLoader;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| backend | [IAnalyticalBackend](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.ianalyticalbackend/index.md) | an instance of analytical backend |

**Returns:**

[IDashboardLoader](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-loaders/sdk-ui-loaders.idashboardloader/index.md)

### IDashboardLoader.withBaseProps()

Specify an instance of [IDashboardBaseProps](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/sdk-ui-dashboard.idashboardbaseprops/index.md) to use for the dashboard component.

**Signature:**

```typescript
withBaseProps(props: IDashboardBaseProps): IDashboardLoader;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| props | [IDashboardBaseProps](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/sdk-ui-dashboard.idashboardbaseprops/index.md) | base props to use |

**Returns:**

[IDashboardLoader](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-loaders/sdk-ui-loaders.idashboardloader/index.md)

#### Remarks

Note: the base props may also contain backend and workspace parameters. The loader can work with them. If specified, they are equivalent to calling [IDashboardLoader.onBackend()](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-loaders/sdk-ui-loaders.idashboardloader/index.md#idashboardloaderonbackend) and/or [IDashboardLoader.fromWorkspace()](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-loaders/sdk-ui-loaders.idashboardloader/index.md#idashboardloaderfromworkspace)

### IDashboardLoader.withEmbeddedPlugins()

Specify embedded plugins to use on top of any plugins that the dashboard is already configured to use.

**Signature:**

```typescript
withEmbeddedPlugins(...plugins: IEmbeddedPlugin[]): IDashboardLoader;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| plugins | [IEmbeddedPlugin](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-loaders/sdk-ui-loaders.iembeddedplugin/index.md)[] | extra plugins to use |

**Returns:**

[IDashboardLoader](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-loaders/sdk-ui-loaders.idashboardloader/index.md)

#### Remarks

The embedded plugins are implemented, built and linked into the application that loads the dashboard. There is no specific runtime loading and linkage required for these plugins.

The lifecycle of the embedded plugins follows the lifecycle of normal plugins that may be linked with the dashboard; instead of loading the plugin assets, the loader will call embedded plugin's factory function to obtain an instance of the actual dashboard plugin to use. From this point on, the lifecycle is the same as for normal plugins:

1. The loader will call the onPluginLoaded, pass any parameters that may be specified for the embedded plugin 2. Plugin registration is done same as for normal plugins 3. The loader will call onPluginUnload when the dashboard containing the plugins gets unmounted

### IDashboardLoader.withFilterContext()

Override filter context to use for the loaded dashboard.

**Signature:**

```typescript
withFilterContext(filterContextRef: ObjRef): IDashboardLoader;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| filterContextRef | [ObjRef](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.objref/index.md) | reference to filter context to use instead of the default filter context |

**Returns:**

[IDashboardLoader](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-loaders/sdk-ui-loaders.idashboardloader/index.md)

#### Remarks

Note: Each dashboard has its own, default filter context - that filter context will be used automatically unless you override it using this call. You typically don't need to do this: filter context overrides are needed most commonly during export and scheduled exports - where application has to create point-in-time snapshot of the filters so that they can be reused during exports instead of the default filter context.
