# DashboardApi

Canonical page: https://www.adaptabletools.com/docs/reference/dashboardapi

Functions relating to the AdapTable Dashboard.

```ts title="TypeScript"
export interface DashboardApi 
```

## Methods

| Method | Returns | Description |
| --- | --- | --- |
| [collapseDashboard()](https://www.adaptabletools.com/docs/reference/dashboardapi.md#collapsedashboard) | `void` | Collapses Dashboard so only Dashboard Header is visible (and not Toolbars&#39; contents) |
| [dockDashboard()](https://www.adaptabletools.com/docs/reference/dashboardapi.md#dockdashboard) | `void` | Docks Dashboard so it &#39;snaps back&#39; into its customary position above the grid |
| [expandDashboard()](https://www.adaptabletools.com/docs/reference/dashboardapi.md#expanddashboard) | `void` | Expands Dashboard so Toolbars in Active Tab are fully visible |
| [floatDashboard()](https://www.adaptabletools.com/docs/reference/dashboardapi.md#floatdashboard) | `void` | Floats Dashboard so only Dashboard Header is visible (in reduced size); can be dragged to a new location |
| [getActiveTab()](https://www.adaptabletools.com/docs/reference/dashboardapi.md#getactivetab) | [`DashboardTab`](https://www.adaptabletools.com/docs/reference/dashboardtab.md)` \| undefined` | Returns current Active Tab (if there is one) |
| [getActiveTabIndex()](https://www.adaptabletools.com/docs/reference/dashboardapi.md#getactivetabindex) | `number \| undefined` | Returns current Active Tab index (if there is one) |
| [getCurrentToolbars()](https://www.adaptabletools.com/docs/reference/dashboardapi.md#getcurrenttoolbars) | `AdaptableDashboardToolbars \| string[]` | Retrieves all Toolbars in Active Tab |
| [getCustomDashboardButtonByLabel(buttonLabel)](https://www.adaptabletools.com/docs/reference/dashboardapi.md#getcustomdashboardbuttonbylabel) | [`AdaptableButton`](https://www.adaptabletools.com/docs/reference/adaptablebutton.md)`<`[`DashboardButtonContext`](https://www.adaptabletools.com/docs/reference/dashboardbuttoncontext.md)`> \| undefined` | Retrieves first Custom Button with given Label |
| [getCustomDashboardButtons()](https://www.adaptabletools.com/docs/reference/dashboardapi.md#getcustomdashboardbuttons) | [`AdaptableButton`](https://www.adaptabletools.com/docs/reference/adaptablebutton.md)`<`[`DashboardButtonContext`](https://www.adaptabletools.com/docs/reference/dashboardbuttoncontext.md)`>[]` | Retrieves all Custom Buttons |
| [getCustomToolbarByName(customToolbarName)](https://www.adaptabletools.com/docs/reference/dashboardapi.md#getcustomtoolbarbyname) | [`CustomToolbar`](https://www.adaptabletools.com/docs/reference/customtoolbar.md) | Returns Custom Toolbar with the given name |
| [getCustomToolbarHTMLElement(customToolbarName)](https://www.adaptabletools.com/docs/reference/dashboardapi.md#getcustomtoolbarhtmlelement) | `HTMLElement \| null` | Returns the HTML Element for the given Custom Toolbar. This should only be used in Vanilla AdapTable for toolbars created via a `render` function. |
| [getCustomToolbars()](https://www.adaptabletools.com/docs/reference/dashboardapi.md#getcustomtoolbars) | [`CustomToolbar`](https://www.adaptabletools.com/docs/reference/customtoolbar.md)`[]` | Retrieves all Custom Toolbars |
| [getDashboardState()](https://www.adaptabletools.com/docs/reference/dashboardapi.md#getdashboardstate) | [`DashboardState`](https://www.adaptabletools.com/docs/reference/dashboardstate.md) | Retrieves Dashboard section from Adaptable State |
| [getModuleButtons()](https://www.adaptabletools.com/docs/reference/dashboardapi.md#getmodulebuttons) | `AdaptableModuleButtons` | Retrieves the Module Buttons in the Dashboard |
| [getPinnedToolbars()](https://www.adaptabletools.com/docs/reference/dashboardapi.md#getpinnedtoolbars) | `AdaptableDashboardToolbars \| string[]` | Retrieves pinned toolbars |
| [getTabByName(tabName)](https://www.adaptabletools.com/docs/reference/dashboardapi.md#gettabbyname) | [`DashboardTab`](https://www.adaptabletools.com/docs/reference/dashboardtab.md) | Retrieves the Tab from State that matches inputted name |
| [getTabs()](https://www.adaptabletools.com/docs/reference/dashboardapi.md#gettabs) | [`DashboardTab`](https://www.adaptabletools.com/docs/reference/dashboardtab.md)`[]` | Retrieves the Tabs in the Dashboard |
| [hideDashboard()](https://www.adaptabletools.com/docs/reference/dashboardapi.md#hidedashboard) | `void` | Hides the Dashboard so cannot be seen |
| [isDashboardCollapsed()](https://www.adaptabletools.com/docs/reference/dashboardapi.md#isdashboardcollapsed) | `boolean` | Is Dashboard Collapsed |
| [isDashboardDocked()](https://www.adaptabletools.com/docs/reference/dashboardapi.md#isdashboarddocked) | `boolean` | Is Dashboard Docked |
| [isDashboardExpanded()](https://www.adaptabletools.com/docs/reference/dashboardapi.md#isdashboardexpanded) | `boolean` | Is Dashboard Expanded |
| [isDashboardFloating()](https://www.adaptabletools.com/docs/reference/dashboardapi.md#isdashboardfloating) | `boolean` | Is Dashboard Floating |
| [isDashboardHidden()](https://www.adaptabletools.com/docs/reference/dashboardapi.md#isdashboardhidden) | `boolean` | Is Dashboard Hidden |
| [isDashboardVisible()](https://www.adaptabletools.com/docs/reference/dashboardapi.md#isdashboardvisible) | `boolean` | Is Dashboard Visible |
| [isToolbarVisible(toolbar)](https://www.adaptabletools.com/docs/reference/dashboardapi.md#istoolbarvisible) | `boolean` | Checks if a given Toolbar is visible |
| [openDashboardSettingsPanel()](https://www.adaptabletools.com/docs/reference/dashboardapi.md#opendashboardsettingspanel) | `void` | Opens Settings Panel with Dashboard section selected and visible |
| [refreshDashboard()](https://www.adaptabletools.com/docs/reference/dashboardapi.md#refreshdashboard) | `void` | Refreshes entire Dashboard, including Toolbars and Buttons; particularly relevant for AdapTable built-in elements, as framework components are dependent on the framework specific change detection mechanisms |
| [resetCustomToolbarFormData(customToolbarName)](https://www.adaptabletools.com/docs/reference/dashboardapi.md#resetcustomtoolbarformdata) | `void` | Resets the data of a Custom Toolbar&#39;s `toolbarForm` back to the<br/>`defaultValue`s declared on its fields - clearing any user input<br/>without unmounting / re-mounting the toolbar.<br/><br/>Useful for &quot;Clear filters&quot; buttons that need to wipe both the grid<br/>filter AND the toolbar form&#39;s internal state in a single click. |
| [setActiveTab(tabName)](https://www.adaptabletools.com/docs/reference/dashboardapi.md#setactivetab) | `void` | Selects the Dashboard tab with this name. |
| [setActiveTabIndex(tabIndex)](https://www.adaptabletools.com/docs/reference/dashboardapi.md#setactivetabindex) | `void` | Selects the Dashboard tab at this index. |
| [setCustomToolbarHTMLContent(customToolbarName, htmlContent)](https://www.adaptabletools.com/docs/reference/dashboardapi.md#setcustomtoolbarhtmlcontent) | `void` | Renders the given HTML string in the given Custom Toolbar. This should only be used in Vanilla AdapTable for toolbars created via a `render` function! |
| [setDashboardTitle(title)](https://www.adaptabletools.com/docs/reference/dashboardapi.md#setdashboardtitle) | `void` | Sets the title shown in the Dashboard header. |
| [setModuleButtons(moduleButtons)](https://www.adaptabletools.com/docs/reference/dashboardapi.md#setmodulebuttons) | `void` | Sets which Module Buttons are visible |
| [setPinnedToolbars(toolbars)](https://www.adaptabletools.com/docs/reference/dashboardapi.md#setpinnedtoolbars) | `void` | Pins toolbars so they stay visible when the active tab changes. |
| [setTabs(Tabs)](https://www.adaptabletools.com/docs/reference/dashboardapi.md#settabs) | `void` | Replaces the tabs shown in the Dashboard. |
| [showDashboard()](https://www.adaptabletools.com/docs/reference/dashboardapi.md#showdashboard) | `void` | Makes the Dashboard visible |

## Method Details

### collapseDashboard

Collapses Dashboard so only Dashboard Header is visible (and not Toolbars&#39; contents)

```ts title="TypeScript"
collapseDashboard(): void;
```

###### Returns

`void`

### dockDashboard

Docks Dashboard so it &#39;snaps back&#39; into its customary position above the grid

```ts title="TypeScript"
dockDashboard(): void;
```

###### Returns

`void`

### expandDashboard

Expands Dashboard so Toolbars in Active Tab are fully visible

```ts title="TypeScript"
expandDashboard(): void;
```

###### Returns

`void`

### floatDashboard

Floats Dashboard so only Dashboard Header is visible (in reduced size); can be dragged to a new location

```ts title="TypeScript"
floatDashboard(): void;
```

###### Returns

`void`

### getActiveTab

Returns current Active Tab (if there is one)

```ts title="TypeScript"
getActiveTab(): DashboardTab | undefined;
```

###### Returns

 Current Active Tab (if there is one)

[`DashboardTab`](https://www.adaptabletools.com/docs/reference/dashboardtab.md)` | undefined`

### getActiveTabIndex

Returns current Active Tab index (if there is one)

```ts title="TypeScript"
getActiveTabIndex(): number | undefined;
```

###### Returns

 Current Active Tab index (if there is one)

`number | undefined`

### getCurrentToolbars

Retrieves all Toolbars in Active Tab

```ts title="TypeScript"
getCurrentToolbars(): AdaptableDashboardToolbars | string[];
```

###### Returns

 All Toolbars in Active Tab

`AdaptableDashboardToolbars | string[]`

### getCustomDashboardButtonByLabel

Retrieves first Custom Button with given Label

```ts title="TypeScript"
getCustomDashboardButtonByLabel(buttonLabel: string): AdaptableButton<DashboardButtonContext> | undefined;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| buttonLabel | `string` | the label of the Custom Button to retrieve |

###### Returns

 First Custom Button with given Label

[`AdaptableButton`](https://www.adaptabletools.com/docs/reference/adaptablebutton.md)`<`[`DashboardButtonContext`](https://www.adaptabletools.com/docs/reference/dashboardbuttoncontext.md)`> | undefined`

### getCustomDashboardButtons

Retrieves all Custom Buttons

```ts title="TypeScript"
getCustomDashboardButtons(): AdaptableButton<DashboardButtonContext>[];
```

###### Returns

 All Custom Buttons

[`AdaptableButton`](https://www.adaptabletools.com/docs/reference/adaptablebutton.md)`<`[`DashboardButtonContext`](https://www.adaptabletools.com/docs/reference/dashboardbuttoncontext.md)`>[]`

### getCustomToolbarByName

Returns Custom Toolbar with the given name

```ts title="TypeScript"
getCustomToolbarByName(customToolbarName: string): CustomToolbar;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| customToolbarName | `string` | the name of the Custom Toolbar |

###### Returns

 Custom Toolbar with the given name

[`CustomToolbar`](https://www.adaptabletools.com/docs/reference/customtoolbar.md)

### getCustomToolbarHTMLElement

Returns the HTML Element for the given Custom Toolbar. This should only be used in Vanilla AdapTable for toolbars created via a `render` function.

```ts title="TypeScript"
getCustomToolbarHTMLElement(customToolbarName: string): HTMLElement | null;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| customToolbarName | `string` | the name of the Custom Toolbar |

###### Returns

 The HTML Element for the given Custom Toolbar. This should only be used in Vanilla AdapTable for toolbars created via a `render` function

`HTMLElement | null`

### getCustomToolbars

Retrieves all Custom Toolbars

```ts title="TypeScript"
getCustomToolbars(): CustomToolbar[];
```

###### Returns

 All Custom Toolbars

[`CustomToolbar`](https://www.adaptabletools.com/docs/reference/customtoolbar.md)`[]`

### getDashboardState

Retrieves Dashboard section from Adaptable State

```ts title="TypeScript"
getDashboardState(): DashboardState;
```

###### Returns

 Dashboard section from Adaptable State

[`DashboardState`](https://www.adaptabletools.com/docs/reference/dashboardstate.md)

### getModuleButtons

Retrieves the Module Buttons in the Dashboard

```ts title="TypeScript"
getModuleButtons(): AdaptableModuleButtons;
```

###### Returns

 The Module Buttons in the Dashboard

`AdaptableModuleButtons`

### getPinnedToolbars

Retrieves pinned toolbars

```ts title="TypeScript"
getPinnedToolbars(): AdaptableDashboardToolbars | string[];
```

###### Returns

 Pinned toolbars

`AdaptableDashboardToolbars | string[]`

### getTabByName

Retrieves the Tab from State that matches inputted name

```ts title="TypeScript"
getTabByName(tabName: string): DashboardTab;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| tabName | `string` | the tab to check |

###### Returns

 The Tab from State that matches inputted name

[`DashboardTab`](https://www.adaptabletools.com/docs/reference/dashboardtab.md)

### getTabs

Retrieves the Tabs in the Dashboard

```ts title="TypeScript"
getTabs(): DashboardTab[];
```

###### Returns

 The Tabs in the Dashboard

[`DashboardTab`](https://www.adaptabletools.com/docs/reference/dashboardtab.md)`[]`

### hideDashboard

Hides the Dashboard so cannot be seen

```ts title="TypeScript"
hideDashboard(): void;
```

###### Returns

`void`

### isDashboardCollapsed

Is Dashboard Collapsed

```ts title="TypeScript"
isDashboardCollapsed(): boolean;
```

###### Returns

 `true` when dashboard Collapsed

`boolean`

### isDashboardDocked

Is Dashboard Docked

```ts title="TypeScript"
isDashboardDocked(): boolean;
```

###### Returns

 `true` when dashboard Docked

`boolean`

### isDashboardExpanded

Is Dashboard Expanded

```ts title="TypeScript"
isDashboardExpanded(): boolean;
```

###### Returns

 `true` when dashboard Expanded

`boolean`

### isDashboardFloating

Is Dashboard Floating

```ts title="TypeScript"
isDashboardFloating(): boolean;
```

###### Returns

 `true` when dashboard Floating

`boolean`

### isDashboardHidden

Is Dashboard Hidden

```ts title="TypeScript"
isDashboardHidden(): boolean;
```

###### Returns

 `true` when dashboard Hidden

`boolean`

### isDashboardVisible

Is Dashboard Visible

```ts title="TypeScript"
isDashboardVisible(): boolean;
```

###### Returns

 `true` when dashboard Visible

`boolean`

### isToolbarVisible

Checks if a given Toolbar is visible

```ts title="TypeScript"
isToolbarVisible(toolbar: AdaptableDashboardToolbar | string): boolean;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| toolbar | [`AdaptableDashboardToolbar`](https://www.adaptabletools.com/docs/reference/adaptabledashboardtoolbar.md)` \| string` | toolbar to check visibility for |

###### Returns

 `true` when a given Toolbar is visible

`boolean`

### openDashboardSettingsPanel

Opens Settings Panel with Dashboard section selected and visible

```ts title="TypeScript"
openDashboardSettingsPanel(): void;
```

###### Returns

`void`

### refreshDashboard

Refreshes entire Dashboard, including Toolbars and Buttons; particularly relevant for AdapTable built-in elements, as framework components are dependent on the framework specific change detection mechanisms

```ts title="TypeScript"
refreshDashboard(): void;
```

###### Returns

`void`

### resetCustomToolbarFormData

Resets the data of a Custom Toolbar&#39;s `toolbarForm` back to the
`defaultValue`s declared on its fields - clearing any user input
without unmounting / re-mounting the toolbar.

Useful for &quot;Clear filters&quot; buttons that need to wipe both the grid
filter AND the toolbar form&#39;s internal state in a single click.

```ts title="TypeScript"
resetCustomToolbarFormData(customToolbarName?: string): void;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| customToolbarName | `string` | Name of the Custom Toolbar to reset. If<br/>omitted, every Custom Toolbar that currently hosts a `toolbarForm`<br/>is reset. |

###### Returns

`void`

### setActiveTab

Selects the Dashboard tab with this name.

```ts title="TypeScript"
setActiveTab(tabName: string): void;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| tabName | `string` | Name of the tab |

###### Returns

`void`

### setActiveTabIndex

Selects the Dashboard tab at this index.

```ts title="TypeScript"
setActiveTabIndex(tabIndex: number): void;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| tabIndex | `number` | Zero-based index of the tab |

###### Returns

`void`

### setCustomToolbarHTMLContent

Renders the given HTML string in the given Custom Toolbar. This should only be used in Vanilla AdapTable for toolbars created via a `render` function!

```ts title="TypeScript"
setCustomToolbarHTMLContent(customToolbarName: string, htmlContent: string): void;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| customToolbarName | `string` | name of Custom Toolbar hosting content |
| htmlContent | `string` | HTML string to render |

###### Returns

`void`

### setDashboardTitle

Sets the title shown in the Dashboard header.

```ts title="TypeScript"
setDashboardTitle(title: string): void;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| title | `string` | Title to display |

###### Returns

`void`

### setModuleButtons

Sets which Module Buttons are visible

```ts title="TypeScript"
setModuleButtons(moduleButtons: AdaptableModuleButtons): void;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| moduleButtons | `AdaptableModuleButtons` | buttons to show |

###### Returns

`void`

### setPinnedToolbars

Pins toolbars so they stay visible when the active tab changes.

```ts title="TypeScript"
setPinnedToolbars(toolbars: AdaptableDashboardToolbars | string[]): void;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| toolbars | `AdaptableDashboardToolbars \| string[]` | Toolbars to pin |

###### Returns

`void`

### setTabs

Replaces the tabs shown in the Dashboard.

```ts title="TypeScript"
setTabs(Tabs: DashboardTab[]): void;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| Tabs | [`DashboardTab`](https://www.adaptabletools.com/docs/reference/dashboardtab.md)`[]` | Tabs to set, in order |

###### Returns

`void`

### showDashboard

Makes the Dashboard visible

```ts title="TypeScript"
showDashboard(): void;
```

###### Returns

`void`
