Skip to content

GridToolPanel

Directive that captures an <ng-template> for use as a custom tool panel.

This enables declarative Angular component usage for tool panels that appear in the grid’s side panel.

<tbw-grid [rows]="rows" [gridConfig]="config">
<tbw-grid-tool-panel
id="quick-filters"
title="Quick Filters"
icon="🔍"
tooltip="Apply quick filters"
[order]="10"
>
<ng-template let-grid>
<app-quick-filters [grid]="grid" />
</ng-template>
</tbw-grid-tool-panel>
</tbw-grid>

The template context provides:

  • $implicit / grid: The grid element reference
  • id (required): Unique identifier for the panel
  • title (required): Panel title shown in accordion header
  • icon: Icon for accordion section header (emoji or text)
  • tooltip: Tooltip for accordion section header
  • order: Panel order priority (lower = first, default: 100)

Import the directive in your component:

import { GridToolPanel } from '@toolbox-web/grid-angular';
@Component({
imports: [GridToolPanel],
// ...
})
PropertyTypeDescription
idInputSignal<string>Unique panel identifier (required)
titleInputSignal<string>Panel title shown in accordion header (required)
iconInputSignal<string | undefined>Icon for accordion section header (emoji or text)
tooltipInputSignal<string | undefined>Tooltip for accordion section header
orderInputSignal<number>Panel order priority (lower = first, default: 100)
templateSignal<TemplateRef<any> | undefined>Query for the ng-template content child.

Static type guard for template context. Enables type inference in templates.

ngTemplateContextGuard(dir: GridToolPanel, ctx: unknown): ctx
NameTypeDescription
dirGridToolPanel
ctxunknown

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