Skip to content

AggregationRowConfig

Configuration for an aggregation row (footer/header row with computed values). Replaces the core FooterRowConfig functionality.

PropertyTypeDescription
id?stringOptional identifier (useful for diffing or targeted updates)
position?top | bottomPosition: ‘top’ renders above grid body, ‘bottom’ renders below (default: ‘bottom’)
fullWidth?booleanIf true, row rendered as single spanning cell with label
label?string | (rows: unknown[], columns: ColumnConfig<any>[]) => stringRow label. Can be a static string or a function that receives the current rows and columns for dynamic content.
cells?Record<string, unknown>Static or computed cell values keyed by field
aggregators?Record<string, AggregatorDefinition>Per-field aggregator configuration. Can be a simple string (‘sum’, ‘avg’, etc.), a function, or an object with aggFunc and formatter.

Row label. Can be a static string or a function that receives the current rows and columns for dynamic content.

In full-width mode (fullWidth: true), the label is displayed inline before the aggregated values.

In per-column mode (fullWidth: false, the default), the label renders as an overlay positioned at the left edge of the row, independent of column alignment. It does not truncate with column width.

{ label: 'Totals', aggregators: { price: 'sum' } }
{ label: (rows) => `Total: ${rows.length} rows` }

aggregators: {
quantity: 'sum', // simple built-in
price: { aggFunc: 'sum', formatter: (v) => `$${v.toFixed(2)}` } // with formatter
}

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