1. Data Grid docs
  2. Start here

Data Grid

A data grid for records that stays fast at a million rows, reads Excel and CSV files, talks to your server and exports what the user sees.

8sheets Data Grid shows a table of records and lets people work with it: search, filter, sort, group, total, pivot, chart, select, edit and export, as a list or as a tree. It runs in plain JavaScript modules with no runtime dependencies. Files are read in a Worker, the page keeps a bounded number of rows in the DOM, and a million records stay responsive. Server data plugs in through one query contract, so search, filters and totals always cover the whole result rather than the rows on screen.

It is an add-on to 8sheets Spreadsheet, with its own version and changelog, covered by the same company licence.

Open the sales example

What it does

FeatureWhat you getExample
Local files and arraysXLSX, XLSM, XLTX, CSV and TSV read as a stream in a Worker; arrays of objects, arrays of rows or typed-array columnssales
Remote data and infinite scrollingRows load in cached 100-row blocks as the user scrolls; the total may be unknownserver
Live dataYour updates, added and removed records applied in batches, with the changed cells flashinglive
Search and filtersSearch box, a filter builder with "all" and "any" groups, a filter row with >100 and 10..20 syntax, and Findfilters, large
Sorting and groupingMulti-column sort, nested groups with summaries, saved viewssales
Tree dataRecords under their parents, from a parent field or an outline level, with roll-upstree
TotalsA totals row with sum, average, min, max or count per column, over every matching recordcolumns
Pivot reportsSeveral row, column and value fields, values as shares, running totals or ranks, a chart; locally or on your serverpivot
ColumnsResize, autosize, reorder, pin, hide and rename, with bands over the headingscolumns
Conditional formattingData bars, colour scales and value rulescolumns
Sparklines and chartsA line, column or win/loss chart in each cell, and a chart of the selected cellslive
Cell renderersYour own text or DOM node in a column's cells
ThemesLight, dark, named skins or your own colour tokens; three row densities; six interface languages
Row selectionCheckboxes, select every match without storing each recordselection
EditingIn-cell editing with lists, date pickers and check boxes, field rules, calculated fields, a fill handle, undo and redoedit
Pinned rows, moving and numbersRecords kept on top or at the bottom, rows moved by dragging or between grids, row numberslive
Context menuCopy, filter by value, sort, chart, pin and more on a right-click, with your own commandslive
ExportThe matching or selected records as CSV, XLSX or PDF, flat or with groups, totals and formattingreport, selection
Master/detailPanels of your own under expanded records, one or several at a timedetail
AssistantA view described in words, turned into a checked view state by your own serviceask

Every example also opens in the grid's other languages: add &lang=pl (or de, fr, es, ja) to its address.

A first grid

JavaScript

import { mountTable } from '@8sheets/data-grid';

const grid = await mountTable(document.querySelector('#orders'), {
  title: 'Orders',
  fields: [
    { name: 'Region', type: 'string' },
    { name: 'Units', type: 'number' },
    { name: 'Price', type: 'number', format: '#,##0.00' },
  ],
  data: [
    { Region: 'East', Units: 2, Price: 24 },
    { Region: 'West', Units: 5, Price: 3.5 },
  ],
});

React

import { DataGrid } from '@8sheets/data-grid-react';

const options = {
  title: 'Orders',
  fields: [
    { name: 'Region', type: 'string' },
    { name: 'Units', type: 'number' },
    { name: 'Price', type: 'number', format: '#,##0.00' },
  ],
  data: [
    { Region: 'East', Units: 2, Price: 24 },
    { Region: 'West', Units: 5, Price: 3.5 },
  ],
};

export function Orders() {
  return (
    <div style={{ height: 480 }}>
      <DataGrid options={options} />
    </div>
  );
}

Vue

<script setup>
import { DataGrid } from '@8sheets/data-grid-vue';

const options = {
  title: 'Orders',
  fields: [
    { name: 'Region', type: 'string' },
    { name: 'Units', type: 'number' },
    { name: 'Price', type: 'number', format: '#,##0.00' },
  ],
  data: [
    { Region: 'East', Units: 2, Price: 24 },
    { Region: 'West', Units: 5, Price: 3.5 },
  ],
};
</script>

<template>
  <div style="height: 480px"><DataGrid :options="options" /></div>
</template>

Angular

import { Component } from '@angular/core';
import { DataGridComponent, DataGridOptions } from '@8sheets/data-grid-angular';

@Component({
  selector: 'app-orders',
  imports: [DataGridComponent],
  template: `<eight-data-grid [options]="options" style="height: 480px" />`,
})
export class Orders {
  options: DataGridOptions = {
    title: 'Orders',
    fields: [
      { name: 'Region', type: 'string' },
      { name: 'Units', type: 'number' },
      { name: 'Price', type: 'number', format: '#,##0.00' },
    ],
    data: [
      { Region: 'East', Units: 2, Price: 24 },
      { Region: 'West', Units: 5, Price: 3.5 },
    ],
  };
}

Getting started covers installation, bundlers and the source download.

How it is built

  • A Worker per grid. Reading files, filtering, sorting, grouping and totals run off the main thread. The page only draws.
  • Columns, not objects. Records are stored as typed-array columns. Large arrays of objects are packed into columns in short slices before they reach the Worker, so the page doesn't freeze while they are copied.
  • A bounded DOM. Only the rows and columns near the viewport are drawn, however large the result.
  • A method for everything. Whatever a user can do in the grid, your code can do through its API, and both fire the same events: stateChange, change, beforeEdit, loadEnd and more.
  • The whole result counts. Search, filters, totals, data bars and exports always cover every matching record, locally and through a server source.

Limits

  • The grid shows one table of records. For formulas across sheets, charts and Excel workbooks as a whole, use Spreadsheet.
  • The interface is in English, Polish, German, French, Spanish and Japanese. The German, French, Spanish and Japanese texts are machine translations, not yet reviewed.
  • Calculated fields, the fill handle, Find, transactions and layout exports need local data. A server source builds pivots only when it has a pivot method.