Grid Props
Reference for every input and output exposed by the Angular Grid component, covering data sources, columns, sorting, filtering, and selection inputs today.
The GpGridComponent is a standalone Angular component with OnPush change detection. Binder syntax is standard Angular: [inputName] for inputs and (outputName) for outputs.
Required Inputs
[columns]
Type: AngularColumnDefinition[]
Array of column definitions. See Column Definition for details.
@Component({
standalone: true,
imports: [GpGridComponent],
template: `<gp-grid [columns]="columns" [rowData]="data" [rowHeight]="36" />`,
})
export class MyGridComponent {
columns: AngularColumnDefinition[] = [
{ field: "id", cellDataType: "number", width: 80 },
{ field: "name", cellDataType: "text", width: 200 },
];
}[rowHeight]
Type: number
Height of each row in pixels.
<gp-grid [columns]="columns" [rowData]="data" [rowHeight]="36" />Data Inputs
[rowData]
Type: TData[]
Array of row data objects. The simplest way to provide data.
<gp-grid [columns]="columns" [rowData]="data" [rowHeight]="36" />[dataSource]
Type: DataSource<TData>
Data source for advanced data handling. Use this for server-side data or when you need mutation capabilities. See Data Sources.
<gp-grid [columns]="columns" [dataSource]="dataSource" [rowHeight]="36" />Optional Inputs
[headerHeight]
Type: number
Default: Same as [rowHeight]
Height of the header row in pixels.
<gp-grid [columns]="columns" [rowData]="data" [rowHeight]="36" [headerHeight]="48" />[overscan]
Type: number
Default: 3
Number of rows to render outside the visible viewport.
<gp-grid [columns]="columns" [rowData]="data" [rowHeight]="36" [overscan]="5" />[sortingEnabled]
Type: boolean
Default: true
Enable or disable sorting globally.
<gp-grid [columns]="columns" [rowData]="data" [rowHeight]="36" [sortingEnabled]="false" />[darkMode]
Type: boolean
Default: false
Enable dark mode styling.
<gp-grid [columns]="columns" [rowData]="data" [rowHeight]="36" [darkMode]="true" />[wheelDampening]
Type: number
Default: 0.1
Dampening factor for wheel scrolling (0–1).
Enabling this input activates smooth scrolling for grids that exceed millions of rows by using virtual dampening, which keeps wheel-based navigation fluid on very large datasets.
<gp-grid [columns]="columns" [rowData]="data" [rowHeight]="36" [wheelDampening]="0.2" />[maxFlingVelocity]
Type: number
Default: 20 × rowHeight
Maximum accumulated touch-fling velocity in logical px/ms when scroll virtualization is active. Pair higher values with overscan 10–12 for smoother fast scrolling on touch devices.
<gp-grid
[columns]="columns"
[rowData]="data"
[rowHeight]="36"
[maxFlingVelocity]="2000"
[overscan]="12"
/>Drag & Reorder Inputs / Outputs
[rowDragEntireRow]
Type: boolean
Default: false
When enabled, clicking and dragging any cell in a row initiates a row drag instead of cell selection.
(onRowDragEnd)
Type: RowDragEndEvent
Emitted when a row is dropped after dragging.
@Component({
template: `
<gp-grid
[columns]="columns"
[dataSource]="dataSource"
[rowHeight]="36"
[rowDragEntireRow]="true"
(onRowDragEnd)="handleRowDragEnd($event)"
/>
`,
})
export class MyGridComponent {
handleRowDragEnd({ fromViewIndex, toViewIndex }: RowDragEndEvent) {
this.dataSource.moveRow?.(fromViewIndex, toViewIndex);
}
}(onColumnMoved)
Type: ColumnMovedEvent
Emitted when a column header is dragged to a new position.
@Component({
template: `
<gp-grid
[columns]="columns"
[rowData]="data"
[rowHeight]="36"
(onColumnMoved)="handleColumnMoved($event)"
/>
`,
})
export class MyGridComponent {
handleColumnMoved(event: ColumnMovedEvent) {
console.log(event.columnId, event.fromViewIndex, event.toViewIndex);
}
}(onColumnResized)
Type: ColumnResizedEvent
Emitted when a column is resized by dragging the header edge.
Identity & Edit Inputs / Outputs
[getRowId]
Type: ((row: TData) => RowId) | null
Function to extract a unique ID from each row. Required when (onCellValueChanged) is used.
(onCellValueChanged)
Type: CellValueChangedEvent<TData>
Emitted after a cell value is committed via inline editing or fill-handle drag.
@Component({
template: `
<gp-grid
[columns]="columns"
[rowData]="data"
[rowHeight]="36"
[getRowId]="idGetter"
(onCellValueChanged)="handleCellValueChanged($event)"
/>
`,
})
export class MyGridComponent {
idGetter = (row: MyRow) => row.id;
handleCellValueChanged(event: CellValueChangedEvent<MyRow>) {
console.log(`Row ${event.rowId} changed ${event.oldValue} → ${event.newValue}`);
}
}Styling Inputs
[highlighting]
Type: HighlightingOptions | null
Dynamic row, column, and cell class computation. See the Styling guide.
@Component({
template: `
<gp-grid
[columns]="columns"
[rowData]="data"
[rowHeight]="36"
[highlighting]="highlightingOptions"
/>
`,
})
export class MyGridComponent {
highlightingOptions: HighlightingOptions = {
computeRowClasses: (ctx) =>
ctx.rowIndex != null && ctx.rowIndex % 2 === 1 ? ["zebra-row"] : [],
computeCellClasses: (ctx) =>
ctx.isSelected ? ["bg-blue-50"] : [],
};
}Localization Inputs
[labels]
Type: GridLabelOverrides
Default: English defaults
Override any user-visible grid string: the filter popup, its buttons and placeholders, the empty state and the error prefix. Unspecified labels keep their English defaults.
import { GpGridComponent } from "@gp-grid/angular";
import type { GridLabelOverrides } from "@gp-grid/angular";
@Component({
template: `
<gp-grid
[columns]="columns"
[rowData]="data"
[rowHeight]="36"
[labels]="labels"
/>
`,
})
export class MyGridComponent {
labels: GridLabelOverrides = {
filterTitle: "Filtra: {column}", // {column} is the column header name
and: "E",
apply: "Applica",
emptyState: "Nessun dato",
};
}The most common keys:
| Key | Token | Meaning |
|---|---|---|
filterTitle | {column} | Filter popup title |
and / or | - | Combination toggle |
apply / clear / addCondition / removeCondition | - | Condition buttons |
addGroup / removeGroup | - | Condition-group buttons |
valuePlaceholder / searchPlaceholder / betweenSeparator | - | Inputs |
valuesMode / conditionMode | - | Popup mode toggle |
selectAll / deselectAll / blanks | - | Values-mode controls |
tooManyValues | {count} | Too-many-values message |
emptyState | - | Empty grid message |
errorPrefix | {message} | Error message prefix |
operators.* | - | Filter dropdown labels (contains, startsWith, between, …) |
operators is also a partial override, so one operator can be changed without
copying the English defaults: operators: { contains: "Contiene" }.
Renderer Inputs
[cellRenderers]
Type: Record<string, CellRendererTemplate>
Registry of named cell renderers. Reference by key in column definitions.
[editRenderers]
Type: Record<string, EditRendererTemplate>
Registry of named edit renderers.
[headerRenderers]
Type: Record<string, HeaderRendererTemplate>
Registry of named header renderers.
[cellRenderer]
Type: CellRendererTemplate | null
Global cell renderer for all cells.
[editRenderer]
Type: EditRendererTemplate | null
Global edit renderer.
[headerRenderer]
Type: HeaderRendererTemplate | null
Global header renderer.
[filterRenderers]
Type: Record<string, AngularFilterRenderer>
Registry of named filter renderers, referenced by a column's filterRenderer key.
[filterRenderer]
Type: AngularFilterRenderer | null
Custom filter popup content for every filterable column. See Custom Filter Popup.
Template Ref
You can access the underlying component instance (and its core property) via a template ref:
@Component({
template: `
<gp-grid #grid [columns]="columns" [rowData]="data" [rowHeight]="36" />
<button (click)="sortByName(grid)">Sort by name</button>
`,
})
export class MyGridComponent {
sortByName(grid: GpGridComponent) {
grid.core?.sortFilter.setSort("name", "asc");
}
}Layout, grouping, and write options
The following options are shared across the bindings. Use React props, Vue kebab-case bindings, or Angular inputs; Angular callbacks are outputs.
| Option | Contract |
|---|---|
columnState | ColumnStateUpdate[]; controlled width, order, visibility, and pin overrides by columnId |
columnLayout | "fit" (default) or "fixed" |
columnOverscan | Center-column overscan in CSS pixels; default 240 |
columnGroups / columnGroupLimits | Nested column-id descriptors and creation-only validation budgets |
headerBandHeights | Configured height per header band |
freezeRows | { count }; freezes leading displayed rows below the header |
rowLoading | Row loading and cache configuration |
rowResize / autoFit | Row resize gestures and creation-only measurement bounds |
rowGrouping | Opaque grouping built by createRowGrouping, or null |
groupLabelColumn / groupLabelRenderer | Group and total label customization |
history | Creation-only { maxEntries }; requires getRowId |
pinIcon | Custom pin-toggle SVG |
onColumnPinned / onRowResized | Identity-bearing pin and row-size notifications |
onFrozenRowsChanged | Effective frozen count and limiting reason |
onColumnSchemaRejected / onRowGroupingRejected | Invalid schema or unsupported grouping notifications |
onRowGroupToggled | User-initiated group expansion notification |
onWriteRejected | Rejected write with reason and operation |
onWriteCommitted | One event per write command, with changes and skips; requires getRowId |
See the guides for contracts and examples, and the migration guide for API changes.
API Overview
Browse the full API reference for @gp-grid/angular with details on every component, input, output, and helper exported by the Angular integration package.
Column Definition
Configure each Angular grid column individually with type, width, sorting, filtering, rendering, and editing options through the column definition object.