---
id: "packages/active-grid/api/server-grouping"
title: "Server grouping"
description: "GroupAggregation, GroupByColumn, GroupInfo, ServerGroupRow and 3 more: generated from the source of active-grid."
url: "/packages/active-grid/api/server-grouping"
locale: "en"
revision: "g0mvjxwj5c-88bdbe1c:server-grouping"
---

# Server grouping

Exported by `@workspace/active-grid`. Generated from the package source; part of [the index of every export](/packages/active-grid/api).

## Functions, hooks and constants

**isServerGroupRow**: `(row: unknown) => row is ServerGroupRow`

Type guard: is this row a synthetic server group header?

**isServerLoadMoreRow**: `(row: unknown) => row is ServerLoadMoreRow`

Type guard: is this row a "load more" marker?

## Types

**GroupAggregation**

```ts
interface GroupAggregation {
  field: string;
  func: 'sum' | 'avg' | 'count' | 'min' | 'max';
}
```

Aggregation to compute per group on the server.

The public ServerFetchParams.groupAggregations field accepts this shape.
The grid does not populate that field. The resource or custom fetch adapter
owns server aggregation and returns GroupInfo.aggregations. Client-side
column.server markers do not execute a server query.
See docs/guides/server-grouping.md for the current integration boundary.

**GroupByColumn**

```ts
interface GroupByColumn {
  field: string;
  sort?: 'asc' | 'desc';
}
```

Column to group by in server-side grouping.

**GroupInfo**

```ts
interface GroupInfo {
  key: unknown;
  count: number;
  aggregations?: Record<string, number | string>;
  hasSubGroups?: boolean;
}
```

Metadata for a single group in a grouped response.

**ServerGroupRow**

```ts
interface ServerGroupRow {
  __isServerGroup: true;
  __groupField: string;
  __groupValue: unknown;
  __groupCount: number;
  __groupAggregations?: Record<string, number | string>;
  __hasSubGroups?: boolean;
  __groupKeys: unknown[];
  __depth: number;
}
```

Synthetic row marker used to represent a server-side group header
in the flat row list. The rendering layer recognizes `__isServerGroup`
and renders these as expandable group headers instead of regular data rows.

**ServerLoadMoreRow**

```ts
interface ServerLoadMoreRow {
  __isServerLoadMore: true;
  __groupKeys: unknown[];
  __loadedCount: number;
  __totalCount: number;
  __depth: number;
}
```

Synthetic row marker for a "load more" button within a server-side group.
Rendered as a clickable row that loads the next batch of items for that group.
