# groupBy

Groups rows with equal values. A string array creates nested groups in array order.

Canonical: https://grid.syidax.com/docs/options/groupBy/

<a id="meaning"></a>

## What does this API do?

Groups rows with equal values. A string array creates nested groups in array order.

API for Pro features: Row grouping, built-in aggregation and group totals

<a id="contract"></a>

## Exact input and result types

```typescript
groupBy: string | string[]
```

| Item | Value |
| --- | --- |
| JavaScript name | groupBy |
| HTML attribute | group-by |
| Default | undefined |
| Input type | string \| string[] |

<a id="usage"></a>

## Usage flow

Set this on a property of the Grid element. Pass arrays, objects, and callbacks through JavaScript, and use new arrays or objects when applying changes.

<a id="recipes"></a>

## Feature explanations and examples

- [Grouping and aggregation](https://grid.syidax.com/docs/features/row-grouping.md) — Row grouping collects source rows with the same region or team into expandable groups. Unlike column groups, which organize headers, row groups change displayed rows and aggregation results.
