PGrid docs

A virtualized JavaScript data grid that gets out of your way.

PGrid is a small, extensible data grid for the browser. It renders only what's visible, freezes panes on any side, and treats every built-in feature — selection, editing, copy/paste, formatting — as an extension you can replace or compose.

Quick example

A working grid in fewer than 25 lines.

import { PGrid } from '@panitw/pgrid';
import '@panitw/pgrid/styles';

const grid = new PGrid({
    rowHeight: 32,
    columnWidth: 130,
    selection: { cssClass: 'cell-selected' },
    editing: true,
    autoUpdate: true,
    columns: [
        { id: 0, field: 'name',  title: 'Name',  width: 180, editable: true },
        { id: 1, field: 'email', title: 'Email', width: 240 },
        { id: 2, field: 'role',  title: 'Role',  width: 140 }
    ],
    headerRows: [{ i: 0, cssClass: 'grid-header' }],
    dataModel: {
        format: 'rows',
        fields: ['name', 'email', 'role'],
        data: [
            { name: 'Ada Lovelace',  email: 'ada@example.com',   role: 'Engineer' },
            { name: 'Linus Torvalds', email: 'linus@example.com', role: 'Manager'  }
        ]
    }
});

grid.render(document.getElementById('grid'));

Features

Every feature has a focused, runnable demo. Click any card to see it live.

Why PGrid?