# ToolPanelApi

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

Functions for managing the AdapTable ToolPanel Component (at side of grid)

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

## Methods

| Method | Returns | Description |
| --- | --- | --- |
| [closeAdapTableToolPanel()](https://www.adaptabletools.com/docs/reference/toolpanelapi.md#closeadaptabletoolpanel) | `void` | Closes the Tool Panel section (irrespective of which toolpanel is showing) |
| [getCustomToolPanelButtons()](https://www.adaptabletools.com/docs/reference/toolpanelapi.md#getcustomtoolpanelbuttons) | [`AdaptableButton`](https://www.adaptabletools.com/docs/reference/adaptablebutton.md)`<`[`ToolPanelButtonContext`](https://www.adaptabletools.com/docs/reference/toolpanelbuttoncontext.md)`>[]` | Retrieves all Custom Tool Panel Buttons defined in ToolPanelOptions |
| [getCustomToolPanelByName(name)](https://www.adaptabletools.com/docs/reference/toolpanelapi.md#getcustomtoolpanelbyname) | [`CustomToolPanel`](https://www.adaptabletools.com/docs/reference/customtoolpanel.md)` \| undefined` | Retrieves the CustomToolPanel with the given name (or undefined if no match is found) |
| [getCustomToolPanels()](https://www.adaptabletools.com/docs/reference/toolpanelapi.md#getcustomtoolpanels) | [`CustomToolPanel`](https://www.adaptabletools.com/docs/reference/customtoolpanel.md)`[]` | Retrieves all Custom Tool Panels defined in ToolPanelOptions |
| [getModuleButtons()](https://www.adaptabletools.com/docs/reference/toolpanelapi.md#getmodulebuttons) | `AdaptableModuleButtons` | The module buttons currently shown in the AdapTable tool panel. |
| [getToolPanelState()](https://www.adaptabletools.com/docs/reference/toolpanelapi.md#gettoolpanelstate) | [`ToolPanelState`](https://www.adaptabletools.com/docs/reference/toolpanelstate.md) | Retrieves Tool Panel section from Tool Panel State |
| [openAdapTableToolPanel()](https://www.adaptabletools.com/docs/reference/toolpanelapi.md#openadaptabletoolpanel) | `void` | Opens the Adaptable ToolPanel Component |
| [setAdaptableToolPanelVisibilityMode(adaptableToolPanel, visibilityMode)](https://www.adaptabletools.com/docs/reference/toolpanelapi.md#setadaptabletoolpanelvisibilitymode) | `void` | Expands or collapses one of the AdapTable tool panels. |
| [setCustomToolPanelVisibilityMode(customToolPanelName, visibilityMode)](https://www.adaptabletools.com/docs/reference/toolpanelapi.md#setcustomtoolpanelvisibilitymode) | `void` | Expands or collapses a custom tool panel. |
| [setModuleButtons(moduleButtons)](https://www.adaptabletools.com/docs/reference/toolpanelapi.md#setmodulebuttons) | `void` | Sets the Module buttons in the Adaptable ToolPanel |
| [showToolPanelPopup()](https://www.adaptabletools.com/docs/reference/toolpanelapi.md#showtoolpanelpopup) | `void` | Opens Settings Panel with Tool Panel section selected and visible |

## Method Details

### closeAdapTableToolPanel

Closes the Tool Panel section (irrespective of which toolpanel is showing)

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

###### Returns

`void`

### getCustomToolPanelButtons

Retrieves all Custom Tool Panel Buttons defined in ToolPanelOptions

```ts title="TypeScript"
getCustomToolPanelButtons(): AdaptableButton<ToolPanelButtonContext>[];
```

###### Returns

 All Custom Tool Panel Buttons defined in ToolPanelOptions

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

### getCustomToolPanelByName

Retrieves the CustomToolPanel with the given name (or undefined if no match is found)

```ts title="TypeScript"
getCustomToolPanelByName(name: string): CustomToolPanel | undefined;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| name | `string` | the CustomToolPanel name |

###### Returns

 The CustomToolPanel with the given name (or undefined if no match is found)

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

### getCustomToolPanels

Retrieves all Custom Tool Panels defined in ToolPanelOptions

```ts title="TypeScript"
getCustomToolPanels(): CustomToolPanel[];
```

###### Returns

 All Custom Tool Panels defined in ToolPanelOptions

[`CustomToolPanel`](https://www.adaptabletools.com/docs/reference/customtoolpanel.md)`[]`

### getModuleButtons

The module buttons currently shown in the AdapTable tool panel.

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

###### Returns

 The module buttons currently shown in the AdapTable tool panel

`AdaptableModuleButtons`

### getToolPanelState

Retrieves Tool Panel section from Tool Panel State

```ts title="TypeScript"
getToolPanelState(): ToolPanelState;
```

###### Returns

 Tool Panel section from Tool Panel State

[`ToolPanelState`](https://www.adaptabletools.com/docs/reference/toolpanelstate.md)

### openAdapTableToolPanel

Opens the Adaptable ToolPanel Component

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

###### Returns

`void`

### setAdaptableToolPanelVisibilityMode

Expands or collapses one of the AdapTable tool panels.

```ts title="TypeScript"
setAdaptableToolPanelVisibilityMode(adaptableToolPanel: AdaptableToolPanel, visibilityMode: ToolPanelVisibilityMode): void;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| adaptableToolPanel | [`AdaptableToolPanel`](https://www.adaptabletools.com/docs/reference/adaptabletoolpanel.md) | Which AdapTable tool panel |
| visibilityMode | [`ToolPanelVisibilityMode`](https://www.adaptabletools.com/docs/reference/toolpanelvisibilitymode.md) | `'expanded'` or `'collapsed'` |

###### Returns

`void`

### setCustomToolPanelVisibilityMode

Expands or collapses a custom tool panel.

```ts title="TypeScript"
setCustomToolPanelVisibilityMode(customToolPanelName: string, visibilityMode: ToolPanelVisibilityMode): void;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| customToolPanelName | `string` | Name of the custom tool panel |
| visibilityMode | [`ToolPanelVisibilityMode`](https://www.adaptabletools.com/docs/reference/toolpanelvisibilitymode.md) | `'expanded'` or `'collapsed'` |

###### Returns

`void`

### setModuleButtons

Sets the Module buttons in the Adaptable ToolPanel

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

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| moduleButtons | `AdaptableModuleButtons` | the module buttons |

###### Returns

`void`

### showToolPanelPopup

Opens Settings Panel with Tool Panel section selected and visible

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

###### Returns

`void`
