Skip to content

HeaderContentDefinition

Since v0.1.1

Header content definition for plugins contributing to shell header center section.

Register via the shell plugin’s registerHeaderContent() to add content between the title and toolbar buttons.

grid.getPluginByName('shell')?.registerHeaderContent({
id: 'row-count',
order: 10,
render: (container) => {
const span = document.createElement('span');
span.className = 'row-count';
span.textContent = `${grid.rows.length} rows`;
container.appendChild(span);
// Update on data changes
const unsub = grid.on('data-change', () => {
span.textContent = `${grid.rows.length} rows`;
});
return () => {
unsub();
};
},
});
PropertyTypeDescription
idstringUnique content ID
render(container: HTMLElement) => void | () => voidContent factory - called once when shell header renders
onDestroy?() => voidCalled when content is removed (for cleanup)
order?numberOrder priority (lower = first, default: 100)
AI assistants: For complete API documentation, implementation guides, and code examples for this library, see https://toolboxjs.com/llms-full.txt