Overview
Declarative columns, typed cell templates, sorting, filtering, paging and virtualization. Works with in-memory arrays or a remote data source.
import { ChangeDetectionStrategy, Component } from '@angular/core';
import { OgeCellTemplate, OgeColumn, OgeGrid } from '@oge-ui/grid';
@Component({
selector: 'app-employees',
imports: [OgeCellTemplate, OgeColumn, OgeGrid],
changeDetection: ChangeDetectionStrategy.OnPush,
template: `
<oge-grid [data]="employees" keyField="id" [paging]="{ pageSize: 10 }">
<oge-column field="id" caption="Id" [width]="70" dataType="number" />
<oge-column field="firstName" caption="First Name" />
<oge-column field="department" caption="Department">
<!-- cell templates are plain Angular templates — Tailwind classes just work -->
<span *ogeCellTemplate="let value"
class="rounded-full bg-indigo-50 px-2 py-0.5 text-xs font-medium text-indigo-700">
{{ value }}
</span>
</oge-column>
<oge-column field="salary" caption="Salary" dataType="number" [format]="money" />
</oge-grid>
`,
})
export class EmployeesPage {
readonly employees = [
{ id: 1, firstName: 'Ali', lastName: 'Yılmaz', department: 'Engineering', city: 'İstanbul', salary: 8400, hireDate: '2019-03-11' },
{ id: 2, firstName: 'Ayşe', lastName: 'Kaya', department: 'Sales', city: 'Ankara', salary: 7200, hireDate: '2020-07-02' },
{ id: 3, firstName: 'Mehmet', lastName: 'Demir', department: 'Engineering', city: 'İzmir', salary: 9100, hireDate: '2018-01-23' },
{ id: 4, firstName: 'Zeynep', lastName: 'Şahin', department: 'Finance', city: 'İstanbul', salary: 6800, hireDate: '2021-11-15' },
{ id: 5, firstName: 'Emre', lastName: 'Çelik', department: 'Support', city: 'Bursa', salary: 5400, hireDate: '2022-05-09' },
];
protected readonly money = (value: unknown): string =>
`₺${(value as number).toLocaleString('tr-TR')}`;
}API
The complete reference — every input, two-way model, imperative method, event and supporting type of <oge-grid> and <oge-column> — lives on the API Reference page.
Export
CSV ships in the core bundle; Excel lives in the separate @oge-ui/grid/export-excel entry point (backed by exceljs) and PDF in @oge-ui/grid/export-pdf (backed by jspdf + jspdf-autotable), so they only load when you import them — typically via a dynamic import().
- Paging is ignored by default: the export contains the full filtered + sorted set, not just the visible page. Pass
{ scope: 'page' }for the current page only, or'selection'for the selected rows. - Master-detail & groups: exports contain data rows only. Detail rows are arbitrary templates and group headers are view artifacts — re-group in Excel via the auto-filter, or feed
getExportData()into a custom exporter if you need more. - Numbers and dates are written as typed Excel cells; lookup and boolean columns use their display text.
customizeCellrewrites individual cells in every exporter — return a replacement (typed values stay typed in Excel) orundefinedto keep the default.
The demo grid above hosts its export buttons via the ogeToolbar attribute — any projected element with it lands in the grid's toolbar next to the built-in controls.
Templates
*ogeCellTemplate="let value; row as r" customizes cells, *ogeHeaderTemplate="let column" customizes headers, *ogeEditTemplate swaps in your own editor, *ogeDetailTemplate renders master-detail content, *ogeRowTemplate replaces the whole row and *ogeNoDataTemplate the empty state — all fully typed via template context guards. Elements marked with the ogeToolbar attribute project into the grid toolbar.