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

# IDashboardLayoutCustomizer

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

Set of functions you can use to customize the layout of the dashboard rendered.

**Signature:**

```typescript
export interface IDashboardLayoutCustomizer 
```

## Methods

| Method | Description |
| --- | --- |
| [customizeExportLayout(fun)](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/sdk-ui-dashboard.idashboardlayoutcustomizer/index.md#idashboardlayoutcustomizercustomizeexportlayout) | Register customization of the export layout that is used to render the dashboard. |
| [customizeFluidLayout(fun)](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/sdk-ui-dashboard.idashboardlayoutcustomizer/index.md#idashboardlayoutcustomizercustomizefluidlayout) | Register customization of the fluid layout that is used to render the dashboard. |
| [withCustomDecorator(providerFactory)](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/sdk-ui-dashboard.idashboardlayoutcustomizer/index.md#idashboardlayoutcustomizerwithcustomdecorator) | Register a factory for top bar decorator providers. |
| [withCustomProvider(provider)](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/sdk-ui-dashboard.idashboardlayoutcustomizer/index.md#idashboardlayoutcustomizerwithcustomprovider) | Register a provider for React components to render layout. |

## Method details

### IDashboardLayoutCustomizer.customizeExportLayout()

Register customization of the export layout that is used to render the dashboard.

**Signature:**

```typescript
customizeExportLayout(fun: ExportLayoutCustomizationFn): IDashboardLayoutCustomizer;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| fun | [ExportLayoutCustomizationFn](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/sdk-ui-dashboard.exportlayoutcustomizationfn/index.md) |  |

**Returns:**

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

#### Remarks

At this point, you can register a function which will be called after dashboard component loads the dashboard and before it starts rendering the layout itself. The function will be called with two arguments:

- The actual dashboard layout - Customizer that allows the plugin to work with export definition

Your customization function may introspect the original layout and then register its customizations.

If the dashboard is not rendering export layout, then the registered function will not be called.

### IDashboardLayoutCustomizer.customizeFluidLayout()

Register customization of the fluid layout that is used to render the dashboard.

**Signature:**

```typescript
customizeFluidLayout(fun: FluidLayoutCustomizationFn): IDashboardLayoutCustomizer;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| fun | [FluidLayoutCustomizationFn](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/sdk-ui-dashboard.fluidlayoutcustomizationfn/index.md) |  |

**Returns:**

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

#### Remarks

At this point, you can register a function which will be called after dashboard component loads the dashboard and before it starts initializing the layout itself. The function will be called with two arguments:

- The actual dashboard layout - Customizer that allows the plugin to add new sections or section items

Your customization function may introspect the original layout and then register its customizations.

If the dashboard is not rendering fluid layout, then the registered function will not be called.

### IDashboardLayoutCustomizer.withCustomDecorator()

Register a factory for top bar decorator providers.

**Signature:**

```typescript
withCustomDecorator(providerFactory: (next: LayoutComponentProvider) => OptionalLayoutComponentProvider): IDashboardLayoutCustomizer;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| providerFactory | (next: [LayoutComponentProvider](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/sdk-ui-dashboard.layoutcomponentprovider/index.md)) =&gt; [OptionalLayoutComponentProvider](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/sdk-ui-dashboard.optionallayoutcomponentprovider/index.md) | factory |

**Returns:**

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

#### Remarks

Decorators are a way to add customizations or embellishments on top of an existing component. Decorators are more complex to write because they need to work with the component they should decorate and add 'something' on top of that component.

This is best illustrated on an example:

#### Example

```tsx
withCustomDecorator((next) => {
    return (filter) => {
        if (some_condition_to_prevent_decoration) {
            return undefined;
        }

        // Make sure you call this outside the component render function,
        // otherwise a new instance of the decorated component is created on each re-render.
        const Decorated = next(filter);

        function MyCustomDecorator(props) {
             return (
                 <div>
                     <p>My Custom Decoration</p>
                     <Decorated {...props} />
                 </div>
             )
        }

        return MyCustomDecorator;
    }
})
```
The above shows how to register a decorator that will use some condition to determine whether particular attribute filter is eligible for decoration.

Note: the factory function that you specify will be called immediately at the registration time. The provider that it returns will be called at render time.

### IDashboardLayoutCustomizer.withCustomProvider()

Register a provider for React components to render layout.

**Signature:**

```typescript
withCustomProvider(provider: OptionalLayoutComponentProvider): IDashboardLayoutCustomizer;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| provider | [OptionalLayoutComponentProvider](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/sdk-ui-dashboard.optionallayoutcomponentprovider/index.md) | provider to register |

**Returns:**

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

self, for call chaining sakes

#### Remarks

A provider takes the layout as input and is expected to return a React component that should be used to render that layout.

If the provider returns `undefined` then:

- if there are other providers registered, they will be called to see if they can provide  a component to render the layout - if there are no other providers registered, the default, built-in component will be used.

You may register multiple providers. They will be evaluated in the order you register them.
