# Configuring the Tool Panel

Canonical page: https://www.adaptabletools.com/docs/ui-tool-panel-configuring

- This page describes how to set up the [AdapTable Tool Panel Component](https://www.adaptabletools.com/docs/ui-tool-panel/index.md) in AG Grid `sideBar` and AdapTable `toolPanelOptions`
- A default implementation is suitable for most use cases
- Developers can provide a bespoke `sideBar` configuration in `gridOptions` when required

## Setting up Tool Panel Component

You do not register `AdaptableToolPanel` yourself in framework apps — AdapTable supplies it when `adaptable` is included in `sideBar`. See [Version 12 release note](https://www.adaptabletools.com/support/version-12-release-note) only if you still have legacy direct component registration.

There are 3 options available when configuring the `sideBar` property in AG Grid `GridOptions`:

- [Setting the SideBar to true](#sidebar-is-set-to-true)
- [Providing a List of ToolPanels](#list-of-toolpanels)
- [Customising the SideBar](#customised-sidebar)

### SideBar is set to true

This is the most straightforward and uses the default AG Grid and AdapTable settings:

```ts
gridOptions.sideBar = true
```

When `sideBar` is *true*:

- AG Grid provides the **Filters** and **Columns** tool panels
- AdapTable appends the **AdapTable** tool panel (`adaptable`)

### What does AdapTable create when sideBar is true?

When `sideBar` is *true* or when `adaptable` is added to the tool panel list (see below), AdapTable creates this config:

```ts
{
    id: 'adaptable',
    toolPanel: 'AdaptableToolPanel',
    labelDefault: 'AdapTable',
    labelKey: 'adaptable',
    iconKey: 'menu', // use an AG Grid icon - full list at https://www.ag-grid.com/javascript-data-grid/custom-icons/
    width: 200, // customise with "--ab-cmp-toolpanel__width" CSS variable
    minWidth: 200,
}
``` 

### List of ToolPanels

A slightly more bespoke alternative is to list which ToolPanels are required:

```ts
gridOptions.sideBar =['adaptable', 'filters']
```

When the user provides a list of ToolPanels, the following happens:

- AG Grid will create any AG Grid ToolPanels named in the list
- AdapTable will create the AdapTable Tool Panel (assuming that 'adaptable' is in the list)
- The ToolPanels will display in the order provided

### Customised Sidebar

For more advanced scenarios a fully, customised Sidebar can be provided in AG Grid GridOptions.

```ts
gridOptions.sideBar ={
  toolPanels: [
    'filters',
    {
      id: 'adaptable', // never change this
      toolPanel: 'AdaptableToolPanel', // never change this
      labelDefault: 'AdapTable',
      iconKey: 'menu',
      width: 200,
      minWidth: 200,
      maxWidth: 300,
    }
  ],
  defaultToolPanel: 'adaptable',
  position: 'left',
}
```

In this scenario:

- the Tool Panels will display in the order provided
- The AdapTable Tool Panel Component will be configured based on the properties provided

- Make sure that the values for the `id` and `toolPanel` properties are not changed
- They should remain as 'adaptable' and 'AdaptableToolPanel' respectively

## Hiding AdapTable Tool Panel

It is possible to hide the AdapTable Tool Panel but still display one or more of the AG Grid Tool Panels (and / or to provide a custom one).

To hide the Side Bar altogether simply leave out the `sideBar` property in AG Grid GridOptions

There are 2 ways to hide the AdapTable Tool Panel:

- setting the [Module Entitlement](https://www.adaptabletools.com/docs/handbook-permissioning-modules/index.md) for Tool Panel to `Hidden`
- leave out `adaptable` from the list of Tool Panels - e.g. setting: `gridOptions.sideBar =['columns', 'filters']`

If the Tool Panel Module entitlement is *Hidden*, the AdapTable Tool Panel will not display even if `adaptable` is listed in `sideBar`. See [Module Entitlements](https://www.adaptabletools.com/docs/handbook-permissioning-modules/index.md).

## Hiding ToolPanels Dropdown

Option not to display the Tool Panels available at the top of the AdapTable Tool Panel Component.

### `showToolPanelsDropdown`

Displays the Dropdown showing the available Tool Panels

By default the AdapTable Tool Panel Component will display the Tool Panel dropdown.

This lists all the available Tool Panels with a checkbox to render them visible / hidden.

Set this property to false to hide this dropdown from users.

```ts {4}
// Do not show the available Tool Panels dropdown
const adaptableOptions: AdaptableOptions = {
  toolPanelOptions: {
    showToolPanelsDropdown: false,
  },
};
```
