Angular Data Grid Overview

Overview

A single kitchen-sink Angular Data Grid demo — 10,000 rows across fourteen columns with the toolbar, per-column filters, sizing, pinning, selection and a column chooser all turned on at once.

On this page

This page is the kitchen-sink demo: one grid with every interaction feature turned on at once, so you can see how they compose. It renders 10,000 rows across fourteen columns — four hidden by default — with the toolbar, per-column filters, column sizing, pinning, ordering & visibility, the column menu, row selection, multi-column sorting and pagination.

Every one of these is a single input, documented on its own page — this demo just enables them together.

1 Alice Smith [email protected] Engineering Manager active $45,000 0.5 Poland 1/1/2021
2 Bob Jones [email protected] Sales Lead invited $46,500 1 Germany 2/2/2021
3 Carol Brown [email protected] Marketing Senior suspended $48,000 1.5 France 3/3/2021
4 Dave Taylor [email protected] Support Junior active $49,500 2 Spain 4/4/2021
5 Eve Wilson [email protected] Finance Contractor invited $51,000 2.5 Italy 5/5/2021
6 Frank Davies [email protected] People Manager suspended $52,500 3 United States 6/6/2021
7 Grace Evans [email protected] Engineering Lead active $54,000 3.5 United Kingdom 7/7/2021
8 Heidi Thomas [email protected] Sales Senior invited $55,500 4 Poland 8/8/2021
9 Ivan Roberts [email protected] Marketing Junior suspended $57,000 4.5 Germany 9/9/2021
10 Judy Walker [email protected] Support Contractor active $58,500 0.5 France 10/10/2021
11 Alice Smith [email protected] Finance Manager invited $60,000 1 Spain 11/11/2021
12 Bob Jones [email protected] People Lead suspended $61,500 1.5 Italy 12/12/2021
13 Carol Brown [email protected] Engineering Senior active $63,000 2 United States 1/13/2021
14 Dave Taylor [email protected] Sales Junior invited $64,500 2.5 United Kingdom 2/14/2021
15 Eve Wilson [email protected] Marketing Contractor suspended $66,000 3 Poland 3/15/2021
16 Frank Davies [email protected] Support Manager active $67,500 3.5 Germany 4/16/2021
17 Grace Evans [email protected] Finance Lead invited $69,000 4 France 5/17/2021
18 Heidi Thomas [email protected] People Senior suspended $70,500 4.5 Spain 6/18/2021
19 Ivan Roberts [email protected] Engineering Junior active $72,000 0.5 Italy 7/19/2021
20 Judy Walker [email protected] Sales Contractor invited $73,500 1 United States 8/20/2021
1–20 of 10000
ts
import { Component } from '@angular/core'
import { DataGridCellDirective, DataGridComponent } from '@coreui/angular-data-grid'
import type { DataGridColumn, DataGridItem } from '@coreui/angular-data-grid'

const firstNames = ['Alice', 'Bob', 'Carol', 'Dave', 'Eve', 'Frank', 'Grace', 'Heidi', 'Ivan', 'Judy']
const lastNames = ['Smith', 'Jones', 'Brown', 'Taylor', 'Wilson', 'Davies', 'Evans', 'Thomas', 'Roberts', 'Walker']
const departments = ['Engineering', 'Sales', 'Marketing', 'Support', 'Finance', 'People']
const roles = ['Manager', 'Lead', 'Senior', 'Junior', 'Contractor']
const statuses = ['active', 'invited', 'suspended']
const countries = ['Poland', 'Germany', 'France', 'Spain', 'Italy', 'United States', 'United Kingdom']
const cities = ['Warsaw', 'Berlin', 'Paris', 'Madrid', 'Rome', 'New York', 'London']

const badges: Record<string, string> = { active: 'success', invited: 'info', suspended: 'danger' }

const currency = (value: unknown) =>
  Number(value).toLocaleString('en-US', { style: 'currency', currency: 'USD', maximumFractionDigits: 0 })
const date = (value: unknown) => new Date(value as string).toLocaleDateString('en-US')

@Component({
  selector: 'docs-data-grid-overview-example',
  imports: [DataGridCellDirective, DataGridComponent],
  template: `
    <c-data-grid
      [columns]="columns"
      [items]="items"
      [itemKey]="itemKey"
      [columnFilters]="true"
      [columnMenu]="true"
      [columnOrder]="true"
      [columnPinning]="{ left: ['id'] }"
      [columnSizing]="true"
      [columnVisibility]="{ projects: false, city: false, lastActive: false, phone: false }"
      [rowSelection]="true"
      [sorting]="{ multiple: true }"
      [pagination]="{ pageSize: 20, pageSizeOptions: [10, 20, 50, 100] }"
      [toolbar]="{ columns: true, export: { filename: 'employees.csv' }, search: true }"
    >
      <ng-template cDataGridCell="status" let-item>
        <span [class]="'badge text-bg-' + badges[item.status]">{{ item.status }}</span>
      </ng-template>
    </c-data-grid>
  `
})
export class DataGridOverviewExample {
  readonly badges = badges
  readonly columns: DataGridColumn[] = [
    {
 key: 'id', label: '#', width: 72, hideable: false
},
    { key: 'name', label: 'Name', width: 180 },
    { key: 'email', label: 'Email', width: 220 },
    {
 key: 'department', label: 'Department', width: 150, filterType: 'select'
},
    {
 key: 'role', label: 'Role', width: 130, filterType: 'select'
},
    {
 key: 'status', label: 'Status', width: 130, filterType: 'select'
},
    {
 key: 'salary', label: 'Salary', width: 130, filterType: 'number', formatter: currency
},
    {
 key: 'rating', label: 'Rating', width: 110, filterType: 'number'
},
    {
 key: 'projects', label: 'Projects', width: 120, filterType: 'number'
},
    {
 key: 'country', label: 'Country', width: 160, filterType: 'select'
},
    { key: 'city', label: 'City', width: 150 },
    {
 key: 'startDate', label: 'Started', width: 140, filterType: 'date', formatter: date
},
    {
 key: 'lastActive', label: 'Last active', width: 140, filterType: 'date', formatter: date
},
    { key: 'phone', label: 'Phone', width: 160 }
  ]
  readonly items: DataGridItem[] = Array.from({ length: 10000 }, (_, i) => ({
    id: i + 1,
    name: `${firstNames[i % firstNames.length]} ${lastNames[i % lastNames.length]}`,
    email: `user${i + 1}@example.com`,
    department: departments[i % departments.length],
    role: roles[i % roles.length],
    status: statuses[i % statuses.length],
    salary: 45000 + ((i % 60) * 1500),
    rating: ((i % 9) + 1) / 2,
    projects: (i % 24) + 1,
    country: countries[i % countries.length],
    city: cities[i % cities.length],
    startDate: new Date(2021, i % 12, (i % 28) + 1).toISOString(),
    lastActive: new Date(2026, i % 6, (i % 27) + 1).toISOString(),
    phone: `+1 555 ${String(1000 + (i % 9000))}`
  }))
  readonly itemKey = (item: DataGridItem) => String(item.id)
}

What’s turned on

InputFeature
[toolbar]Column chooser, CSV export and global search
[columnFilters] + filterTypePer-column typed filters (text, number, date, select)
[columnSizing]Drag-to-resize columns
[columnPinning]id pinned to the left edge
[columnOrder]Drag-and-drop column reordering
[columnVisibility]Four columns hidden until you show them
[columnMenu]Per-header sort / pin / hide menu
[rowSelection]Checkbox column with select-all
[sorting]="{ multiple: true }"Shift-click multi-column sort
[pagination]Page size switcher

Presentation

salary and the two dates use a column formatter so the displayed value — and the CSV export — reads as currency and localized dates. The status column uses a cDataGridCell template to draw a colored badge. Everything else is the raw value.

To scale past what fits in the browser, keep this UI and hand data fetching off to your API with server-side data.