Glide Data Grid

A relatively small HTML5 Canvas based data editor supporting millions of ro...


Glide Data Grid

A canvas-based data grid, supporting millions of rows, rapid updating, and native scrolling.

Built as the basis for the Glide Data Editor. We're hiring.

Glide Data Grid with sample data
Version React 16+ Code Coverage npm bundle size License Made By Glide

👩‍💻 Demo and features

Lot's of fun examples are in our Storybook.

You can also visit our main site.


-   It scales to millions of rows. Cells are rendered lazily on demand for memory efficiency.
-   Scrolling is extremely fast. Native scrolling keeps everything buttery smooth.
-   Supports multiple types of cells. Numbers, text, markdown, bubble, image, drilldown, uri
-   Fully Free & Open Source. MIT licensed, so you can use Grid in commercial projects.
-   Editing is built in.
-   Resizable and movable columns.
-   Variable sized rows.
-   Merged cells.
-   Single and multi-select rows, cells, and columns.
-   Cell rendering can be fully customized.

⚡ Quick Start

First make sure you are using React 16 or greater. Then install the data grid:

  1. ``` sh
  2. npm i @glideapps/glide-data-grid
  3. ```

You may also need to install the peer dependencies if you don't have them already:

  1. ``` sh
  2. npm i lodash marked react-responsive-carousel
  3. ```

Create a new DataEditor wherever you need to display lots and lots of data

  1. ```tsx
  2. <DataEditor getCellContent={getData} columns={columns} rows={numRows} />
  3. ```

Don't forget to import mandatory CSS

  1. ```ts
  2. import "@glideapps/glide-data-grid/dist/index.css";
  3. ```

Making your columns is easy

  1. ```ts
  2. // Grid columns may also provide icon, overlayIcon, menu, style, and theme overrides
  3. const columns: GridColumn[] = [
  4.     { title: "First Name", width: 100 },
  5.     { title: "Last Name", width: 100 },
  6. ];
  7. ```

Last provide data to the grid

  1. ```ts
  2. // If fetching data is slow you can use the DataEditor ref to send updates for cells
  3. // once data is loaded.
  4. function getData([col, row]: Item): GridCell {
  5.     const person = getData(row);

  6.     if (col === 0) {
  7.         return {
  8.             kind: GridCellKind.Text,
  9.             data: person.firstName,
  10.             allowOverlay: false,
  11.             displayData: person.firstName,
  12.         };
  13.     } else if (col === 1) {
  14.         return {
  15.             kind: GridCellKind.Text,
  16.             data: person.lastName,
  17.             allowOverlay: false,
  18.             displayData: person.lastName,
  19.         };
  20.     } else {
  21.         throw new Error();
  22.     }
  23. }
  24. ```

Full API documentation


Nothing shows up!

It crashes when I try to edit a cell!

Does it work with screen readers and other a11y tools?

Yes. Unfortunately none of the primary developers are accessibility users so there are likely flaws in the implementation we are not aware of. Bug reports welcome!

Does it support my data source?


Data Grid is agnostic about the way you load/store/generate/mutate your data. What it requires is that you tell it which columns you have, how many rows, and to give it a function it can call to get the data for a cell in a specific row and column.

Does it do sorting, searching, and filtering?

Search is included. You provide the trigger, we do the search. Example in our storybook.

Filtering and sorting are something you would have to implement with your data source. There are hooks for adding column header menus if you want that.

The reason we don't add filtering/sorting in by default is that these are usually very application-specific, and can often also be implemented more efficiently in the data source, via a database query, for example.

Can it do frozen columns?


Can I render my own cells?

Yes, but the renderer has to use HTML Canvas. Simple example in our Storybook.

Why does Data Grid use HTML Canvas?

Originally we had implemented our Grid using virtualized rendering. We virtualized both in the horizontal and vertical direction using react-virtualized. The problem is simply scrolling performance. Once you need to load/unload hundreds of DOM elements per frame nothing can save you.

There are some hacks you can do like setting timers and entering into a "low fidelity" rendering mode where you only render a single element per cell. This works okay until you want to show hundreds of cells and you are right back to choppy scrolling. It also doesn't really look or feel great.

I want to use this with Next.js / Vercel, but I'm getting weird errors

The easiest way to use the grid with Next is to create a component which wraps up your grid and then import it as a dynamic.


  1. ```tsx
  2. import type { NextPage } from "next";
  3. import dynamic from "next/dynamic";
  4. import styles from "../styles/Home.module.css";

  5. const Grid = dynamic(
  6.     () => {
  7.         return import("../components/Grid");
  8.     },
  9.     { ssr: false }
  10. );

  11. export const Home: NextPage = () => {
  12.     return (
  13.         <div className={styles.container}>
  14.             <main className={styles.main}>
  15.                 <h1 className={styles.title}>Hi</h1>
  16.                 <Grid />
  17.             </main>
  18.         </div>
  19.     );
  20. };
  21. ```


  1. ```tsx
  2. import React from "react";
  3. import DataEditor from "@glideapps/glide-data-grid";

  4. export default function Grid() {
  5.     return <DataEditor {...args} />;
  6. }
  7. ```