# GroupDefinition

> _Since v2.0.0_

Pre-defined group definition for server-side grouping.

When groups are provided externally (e.g. from a server), this interface
describes each group's structure. The plugin renders these groups as
collapsible headers and emits events when users expand/collapse them,
allowing the consumer to lazily load row data.

#### Example

```typescript
const groups: GroupDefinition[] = [
  { key: 'Engineering', value: 'Engineering', rowCount: 150 },
  { key: 'Sales', value: 'Sales', rowCount: 89 },
  { key: 'Marketing', value: 'Marketing', rowCount: 42,
    children: [
      { key: 'Digital', value: 'Digital', rowCount: 20 },
      { key: 'Brand', value: 'Brand', rowCount: 22 },
    ],
  },
];
```

## Properties

| Property | Type | Description |
| -------- | ---- | ----------- |
| `key` | <code>string</code> | Unique group identifier. |
| `value` | <code>unknown</code> | Display value for the group header. |
| `rowCount?` | <code>number</code> | Expected row count from server (for display in group header). |
| `children?` | <code><a href="/grid/plugins/grouping-rows/interfaces/groupdefinition/">GroupDefinition</a>[]</code> | Nested child groups for multi-level grouping. |
| `aggregates?` | <code>Record&lt;string, unknown&gt;</code> | Server-computed aggregate values keyed by field name. |
