# Tool Panel Technical Reference

Canonical page: https://www.adaptabletools.com/docs/technical-reference-tool-panel

## Tool Panel State

| Property | Type | Description | Default |
| --- | --- | --- | --- |
| [ModuleButtons](https://www.adaptabletools.com/docs/reference/toolpanelstate.md#modulebuttons) | `AdaptableModuleButtons` | AdapTable Module Buttons visible in ToolPanel | Empty Array |
| [ToolPanels](https://www.adaptabletools.com/docs/reference/toolpanelstate.md#toolpanels) | [`AdaptableToolPanelDefinition`](https://www.adaptabletools.com/docs/reference/adaptabletoolpaneldefinition.md)`[]` | Tool panels to show, and whether each is expanded or collapsed.<br/><br/>When omitted, every module and every custom tool panel is included, collapsed. |   |

| Property | Type | Description | Default |
| --- | --- | --- | --- |
| [Name](https://www.adaptabletools.com/docs/reference/adaptabletoolpaneldefinition.md#name) | [`AdaptableToolPanel`](https://www.adaptabletools.com/docs/reference/adaptabletoolpanel.md)` \| string` | ToolPanel name - either an Adaptable Module or a Custom ToolPanel (defined in ToolPanel Options) |   |
| [VisibilityMode](https://www.adaptabletools.com/docs/reference/adaptabletoolpaneldefinition.md#visibilitymode) | `'expanded' \| 'collapsed'` | `'expanded'` shows the panel body. `'collapsed'` shows only the header. | &#39;collapsed&#39; |

`Name` is an [`AdaptableToolPanel`](https://www.adaptabletools.com/docs/reference/adaptabletoolpanel.md):

[See API: adaptabletoolpanel](https://www.adaptabletools.com/docs/reference/adaptabletoolpanel.md)

-------------

## Tool Panel Options

| Property | Type | Description | Default |
| --- | --- | --- | --- |
| [customButtons](https://www.adaptabletools.com/docs/reference/toolpaneloptions.md#custombuttons) | [`AdaptableButton`](https://www.adaptabletools.com/docs/reference/adaptablebutton.md)`<`[`ToolPanelButtonContext`](https://www.adaptabletools.com/docs/reference/toolpanelbuttoncontext.md)`>[]` | ToolPanel Buttons provided by Users which perform custom behaviour |   |
| [customToolPanels](https://www.adaptabletools.com/docs/reference/toolpaneloptions.md#customtoolpanels) | [`CustomToolPanel`](https://www.adaptabletools.com/docs/reference/customtoolpanel.md)`[]` | ToolPanels provided by Users which contain custom content |   |
| [showToolPanelsDropdown](https://www.adaptabletools.com/docs/reference/toolpaneloptions.md#showtoolpanelsdropdown) | `boolean` | Display the Tool Panels dropdown | true |

### Custom Buttons

`customButtons` is a list of [`AdaptableButton`](https://www.adaptabletools.com/docs/reference/adaptablebutton.md) objects. The click handler receives a [`ToolPanelButtonContext`](https://www.adaptabletools.com/docs/reference/toolpanelbuttoncontext.md).

| Property | Type | Description | Default |
| --- | --- | --- | --- |
| [buttonStyle](https://www.adaptabletools.com/docs/reference/adaptablebutton.md#buttonstyle) | [`ButtonStyle`](https://www.adaptabletools.com/docs/reference/buttonstyle.md)` \| ((button: `[`AdaptableButton`](https://www.adaptabletools.com/docs/reference/adaptablebutton.md)`<CONTEXT_TYPE>, context: CONTEXT_TYPE) => `[`ButtonStyle`](https://www.adaptabletools.com/docs/reference/buttonstyle.md)`)` | Style for Button - can be object or function that provides a `ButtonStyle` object |   |
| [disabled](https://www.adaptabletools.com/docs/reference/adaptablebutton.md#disabled) | `(button: `[`AdaptableButton`](https://www.adaptabletools.com/docs/reference/adaptablebutton.md)`<CONTEXT_TYPE>, context: CONTEXT_TYPE) => boolean` | Function that disables / enables the button based on its evaluation result |   |
| [hidden](https://www.adaptabletools.com/docs/reference/adaptablebutton.md#hidden) | `(button: `[`AdaptableButton`](https://www.adaptabletools.com/docs/reference/adaptablebutton.md)`<CONTEXT_TYPE>, context: CONTEXT_TYPE) => boolean` | Function which sets whether Button is hidden |   |
| [icon](https://www.adaptabletools.com/docs/reference/adaptablebutton.md#icon) | [`AdaptableIcon`](https://www.adaptabletools.com/docs/reference/adaptableicon.md)` \| ((button: `[`AdaptableButton`](https://www.adaptabletools.com/docs/reference/adaptablebutton.md)`<CONTEXT_TYPE>, context: CONTEXT_TYPE) => `[`AdaptableIcon`](https://www.adaptabletools.com/docs/reference/adaptableicon.md)`)` | Icon for Button - can be object or function that provides a `AdaptableIcon` object |   |
| [iconPosition](https://www.adaptabletools.com/docs/reference/adaptablebutton.md#iconposition) | `'start' \| 'end'` | Where the icon appears relative to the label | &#39;start&#39; |
| [label](https://www.adaptabletools.com/docs/reference/adaptablebutton.md#label) | `string \| ((button: `[`AdaptableButton`](https://www.adaptabletools.com/docs/reference/adaptablebutton.md)`<CONTEXT_TYPE>, context: CONTEXT_TYPE) => string)` | Label for Button - can be string or function that provides string |   |
| [onClick](https://www.adaptabletools.com/docs/reference/adaptablebutton.md#onclick) | `(button: `[`AdaptableButton`](https://www.adaptabletools.com/docs/reference/adaptablebutton.md)`<CONTEXT_TYPE>, context: CONTEXT_TYPE) => void` | Function to invoke when button is clicked |   |
| [tooltip](https://www.adaptabletools.com/docs/reference/adaptablebutton.md#tooltip) | `string \| ((button: `[`AdaptableButton`](https://www.adaptabletools.com/docs/reference/adaptablebutton.md)`<CONTEXT_TYPE>, context: CONTEXT_TYPE) => string)` | Tooltip for Button - can be string or function that provides string |   |

`buttonStyle` is a [`ButtonStyle`](https://www.adaptabletools.com/docs/reference/buttonstyle.md):

| Property | Type | Description | Default |
| --- | --- | --- | --- |
| [className](https://www.adaptabletools.com/docs/reference/buttonstyle.md#classname) | `string` | CSS Classname to use for the Button |   |
| [tone](https://www.adaptabletools.com/docs/reference/buttonstyle.md#tone) | `'success' \| 'error' \| 'neutral' \| 'none' \| 'warning' \| 'info' \| 'accent'` | Button&#39;s Tone - values: &#39;success&#39;, &#39;error&#39;, &#39;neutral&#39;, &#39;none&#39;, &#39;warning&#39;, &#39;info&#39;, &#39;accent&#39; | &#39;neutral&#39; |
| [variant](https://www.adaptabletools.com/docs/reference/buttonstyle.md#variant) | `'text' \| 'outlined' \| 'raised'` | How Button appears - values: &#39;text&#39;, &#39;outlined&#39;, &#39;raised&#39; | &#39;outlined&#39; |

| Property | Type | Description |
| --- | --- | --- |
| [toolPanelState](https://www.adaptabletools.com/docs/reference/toolpanelbuttoncontext.md#toolpanelstate) | [`ToolPanelState`](https://www.adaptabletools.com/docs/reference/toolpanelstate.md) | Current ToolPanel State |
| [adaptableContext](https://www.adaptabletools.com/docs/reference/toolpanelbuttoncontext.md#adaptablecontext) | `any` | Custom application Context provided in `AdaptableOptions.adaptableContext` |

### Custom Tool Panels

| Property | Type | Description |
| --- | --- | --- |
| [buttons](https://www.adaptabletools.com/docs/reference/customtoolpanel.md#buttons) | [`AdaptableButton`](https://www.adaptabletools.com/docs/reference/adaptablebutton.md)`<`[`CustomToolPanelButtonContext`](https://www.adaptabletools.com/docs/reference/customtoolpanelbuttoncontext.md)`>[]` | Optional set of buttons to show in the ToolPanel |
| [frameworkComponent](https://www.adaptabletools.com/docs/reference/customtoolpanel.md#frameworkcomponent) | [`AdaptableFrameworkComponent`](https://www.adaptabletools.com/docs/reference/adaptableframeworkcomponent.md) | Framework-specific (Angular, React or Vue) component to be rendered |
| [name](https://www.adaptabletools.com/docs/reference/customtoolpanel.md#name) | `string` | Name of Custom ToolPanel - should be unique |
| [render](https://www.adaptabletools.com/docs/reference/customtoolpanel.md#render) | `(customRenderContext: `[`CustomRenderContext`](https://www.adaptabletools.com/docs/reference/customrendercontext.md)`) => string \| null` | Function to provide bespoke content when using AdapTable Vanilla |
| [title](https://www.adaptabletools.com/docs/reference/customtoolpanel.md#title) | `string` | Title to display in Custom ToolPanel; if undefined, will default to `name` property |

`buttons` is a list of AdapTable Buttons. The click handler receives a [`CustomToolPanelButtonContext`](https://www.adaptabletools.com/docs/reference/customtoolpanelbuttoncontext.md):

| Property | Type | Description |
| --- | --- | --- |
| [customToolPanel](https://www.adaptabletools.com/docs/reference/customtoolpanelbuttoncontext.md#customtoolpanel) | [`CustomToolPanel`](https://www.adaptabletools.com/docs/reference/customtoolpanel.md) | The Custom ToolPanel which contains the button |
| [adaptableContext](https://www.adaptabletools.com/docs/reference/customtoolpanelbuttoncontext.md#adaptablecontext) | `any` | Custom application Context provided in `AdaptableOptions.adaptableContext` |

-------------

## Tool Panel API

| 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 |
