Skip to content

ToolPanelDefinition

Tool panel definition registered by plugins or consumers.

Register via grid.registerToolPanel() to add panels to the sidebar. Panels appear as collapsible sections with icons and titles.

grid.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');
},
});
PropertyTypeDescription
idstringUnique panel ID
titlestringPanel title shown in accordion header
icon?stringIcon for accordion section header (optional, emoji or SVG)
tooltip?stringTooltip for accordion section header
render(container: HTMLElement) => void | () => voidPanel content factory - called when panel section opens
onClose?() => voidCalled when panel closes (for cleanup)
order?numberPanel order priority (lower = first, default: 100)
AI assistants: For complete API documentation, implementation guides, and code examples for this library, see https://raw.githubusercontent.com/OysteinAmundsen/toolbox/main/llms-full.txt