# ToolPanelDefinition

> _Since v0.1.1_

Tool panel definition registered by plugins or consumers.

Register via the shell plugin's `registerToolPanel()` to add panels to the sidebar.
Panels appear as collapsible sections with icons and titles.

#### Example

```typescript
grid.getPluginByName('shell')?.registerToolPanel({
  id: 'filters',
  title: 'Filters',
  icon: '🔍',
  tooltip: 'Filter grid data',
  order: 10, // Lower = appears first
  render: (container) => {
    container.innerHTML = `
      <div class="filter-panel">
        <input type="text" placeholder="Search..." />
      </div>
    `;
    // Return cleanup function
    return () => container.innerHTML = '';
  },
  onClose: () => {
    console.log('Filter panel closed');
  },
});
```

## Properties

| Property | Type | Description |
| -------- | ---- | ----------- |
| `id` | <code>string</code> | Unique panel ID |
| `title` | <code>string</code> | Panel title shown in accordion header |
| `icon?` | <code>string</code> | Icon for accordion section header (optional, emoji or SVG) |
| `tooltip?` | <code>string</code> | Tooltip for accordion section header |
| `render` | <code>(container: HTMLElement) =&gt; void &#124; () =&gt; void</code> | Panel content factory - called when panel section opens |
| `onClose?` | <code>() =&gt; void</code> | Called when panel closes (for cleanup) |
| `order?` | <code>number</code> | Panel order priority (lower = first, default: 100) |

## See Also

- [`ShellConfig`](/grid/plugins/shell/interfaces/shellconfig.md) for shell configuration
