@glideapps/glide-data-grid vs ag-grid vs react-data-grid
Data Grid Libraries for React
@glideapps/glide-data-gridag-gridreact-data-gridSimilar Packages:

Data Grid Libraries for React

Data grid libraries for React provide powerful, flexible, and efficient table components that can handle large datasets while offering features like sorting, filtering, pagination, and editing. These libraries are designed to integrate seamlessly with React applications, providing customizable and performant grid solutions for displaying and manipulating tabular data. They cater to various use cases, from simple data display to complex enterprise-level applications, ensuring a smooth user experience and efficient data management.

Npm Package Weekly Downloads Trend

3 Years

Github Stars Ranking

Stat Detail

Package
Downloads
Stars
Size
Issues
Publish
License
@glideapps/glide-data-grid171,3715,0673.66 MB1152 years agoMIT
ag-grid12,98815,090-1188 years agoMIT
react-data-grid07,580412 kB683 months agoMIT

Feature Comparison: @glideapps/glide-data-grid vs ag-grid vs react-data-grid

Performance

  • @glideapps/glide-data-grid:

    @glideapps/glide-data-grid is designed for high performance with a lightweight footprint, making it suitable for handling moderate to large datasets efficiently. It uses virtual scrolling to render only the visible rows, reducing the DOM size and improving rendering times.

  • ag-grid:

    ag-grid is optimized for performance and can handle very large datasets with features like row and column virtualization, lazy loading, and efficient rendering algorithms. It is built to scale and maintain performance even with millions of rows, making it ideal for enterprise applications.

  • react-data-grid:

    react-data-grid offers good performance for large datasets, especially with its support for virtualization and efficient rendering. While it may not be as optimized as ag-grid for extremely large datasets, it performs well for most use cases and provides a smooth user experience.

Customization

  • @glideapps/glide-data-grid:

    @glideapps/glide-data-grid provides extensive customization options, allowing developers to easily style the grid, customize cell rendering, and implement custom features. Its API is designed to be flexible, enabling quick adjustments and enhancements without much complexity.

  • ag-grid:

    ag-grid offers one of the most comprehensive customization frameworks among data grid libraries, allowing for deep customization of almost every aspect of the grid, including cell rendering, editing, and even the grid's overall behavior. It supports custom components, themes, and extensive configuration options, making it highly adaptable to various requirements.

  • react-data-grid:

    react-data-grid is highly customizable, especially when it comes to cell rendering and editing. It allows developers to create custom cell editors, renderers, and even entire rows or columns. The grid's API is designed to be flexible, enabling easy integration of custom features while maintaining performance.

Features

  • @glideapps/glide-data-grid:

    @glideapps/glide-data-grid offers a solid set of features for a lightweight grid, including sorting, filtering, inline editing, and customizable cell rendering. While it may not have all the advanced features of larger libraries, it provides enough functionality for most applications while keeping the API simple and intuitive.

  • ag-grid:

    ag-grid is one of the most feature-rich data grid libraries available, offering a wide range of built-in features such as advanced filtering, sorting, grouping, aggregation, pivoting, inline editing, and much more. It also supports enterprise features like row grouping, range selection, and custom tool panels, making it suitable for complex data manipulation tasks.

  • react-data-grid:

    react-data-grid provides a good set of features out of the box, including sorting, filtering, inline editing, and keyboard navigation. It also supports virtualization for better performance with large datasets. While it may not be as feature-rich as ag-grid, it offers enough functionality for most applications and is designed to be easily extensible.

Ease of Use: Code Examples

  • @glideapps/glide-data-grid:

    @glideapps/glide-data-grid is designed to be easy to use, with a simple API and clear documentation. Its lightweight nature and focus on modern web standards make it accessible for developers of all skill levels. The grid's customization options are straightforward, allowing for quick implementation of common features without a steep learning curve.

  • ag-grid:

    ag-grid has a steeper learning curve due to its extensive feature set and configuration options. However, it is well-documented, and once developers become familiar with its API, they can leverage its powerful features to build highly customized and efficient grids. The complexity is often worth it for enterprise applications that require advanced functionality.

  • react-data-grid:

    react-data-grid strikes a good balance between usability and functionality. It has a relatively simple API, especially for common tasks like sorting, filtering, and editing. The documentation is clear, and the grid is designed to be intuitive, making it easy for developers to implement and customize without extensive training.

Code Example

  • @glideapps/glide-data-grid:

    Simple Example of @glideapps/glide-data-grid

    import React from 'react';
    import { DataGrid } from '@glideapps/glide-data-grid';
    import '@glideapps/glide-data-grid/dist/index.css';
    
    const columns = [
      { key: 'id', name: 'ID' },
      { key: 'name', name: 'Name' },
      { key: 'age', name: 'Age' },
    ];
    
    const rows = [
      { id: 1, name: 'John Doe', age: 28 },
      { id: 2, name: 'Jane Smith', age: 34 },
      { id: 3, name: 'Alice Johnson', age: 45 },
    ];
    
    const App = () => (
      <div style={{ height: '300px', width: '400px' }}>
        <DataGrid columns={columns} rows={rows} />
      </div>
    );
    
    export default App;
    
  • ag-grid:

    Simple Example of ag-grid

    import React from 'react';
    import { AgGridReact } from 'ag-grid-react';
    import 'ag-grid-community/styles/ag-grid.css';
    import 'ag-grid-community/styles/ag-theme-alpine.css';
    
    const App = () => {
      const columnDefs = [
        { field: 'make' },
        { field: 'model' },
        { field: 'price' },
      ];
    
      const rowData = [
        { make: 'Toyota', model: 'Celica', price: 35000 },
        { make: 'Ford', model: 'Mondeo', price: 32000 },
        { make: 'Porsche', model: 'Boxster', price: 72000 },
      ];
    
      return (
        <div className='ag-theme-alpine' style={{ height: 400, width: 600 }}>
          <AgGridReact columnDefs={columnDefs} rowData={rowData} />
        </div>
      );
    };
    
    export default App;
    
  • react-data-grid:

    Simple Example of react-data-grid

    import React from 'react';
    import DataGrid from 'react-data-grid';
    
    const columns = [
      { key: 'id', name: 'ID' },
      { key: 'title', name: 'Title' },
      { key: 'status', name: 'Status' },
    ];
    
    const rows = [
      { id: 1, title: 'Task 1', status: 'Completed' },
      { id: 2, title: 'Task 2', status: 'In Progress' },
      { id: 3, title: 'Task 3', status: 'Pending' },
    ];
    
    const App = () => (
      <div style={{ height: 300, width: 400 }}>
        <DataGrid columns={columns} rows={rows} />
      </div>
    );
    
    export default App;
    

How to Choose: @glideapps/glide-data-grid vs ag-grid vs react-data-grid

  • @glideapps/glide-data-grid:

    Choose @glideapps/glide-data-grid if you need a lightweight, highly customizable grid with a focus on performance and modern design. It is ideal for applications that require a simple yet flexible grid solution without the overhead of a large library.

  • ag-grid:

    Choose ag-grid if you need a feature-rich, enterprise-grade grid with extensive capabilities, including advanced data manipulation, virtualization, and a wide range of built-in features. It is suitable for complex applications that require high performance and scalability.

  • react-data-grid:

    Choose react-data-grid if you need a fast, customizable grid with a good balance of features and performance. It is particularly well-suited for applications that require inline editing, keyboard navigation, and a flexible API for customization.

README for @glideapps/glide-data-grid


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.

Features

  • 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 commerical 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:

npm i @glideapps/glide-data-grid

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

npm i lodash marked react-responsive-carousel

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

<DataEditor getCellContent={getData} columns={columns} rows={numRows} />

Don't forget to import mandatory CSS

import "@glideapps/glide-data-grid/dist/index.css";

Making your columns is easy

// Grid columns may also provide icon, overlayIcon, menu, style, and theme overrides
const columns: GridColumn[] = [
    { title: "First Name", width: 100 },
    { title: "Last Name", width: 100 },
];

Last provide data to the grid

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

    if (col === 0) {
        return {
            kind: GridCellKind.Text,
            data: person.firstName,
            allowOverlay: false,
            displayData: person.firstName,
        };
    } else if (col === 1) {
        return {
            kind: GridCellKind.Text,
            data: person.lastName,
            allowOverlay: false,
            displayData: person.lastName,
        };
    } else {
        throw new Error();
    }
}

Full API documentation

The full API documentation is on the main site.

šŸ“’ FAQ

Nothing shows up!

Please read the Prerequisites section in the docs.

It crashes when I try to edit a cell!

Please read the Prerequisites section in the docs.

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?

Yes.

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?

Yes!

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.

home.tsx

import type { NextPage } from "next";
import dynamic from "next/dynamic";
import styles from "../styles/Home.module.css";

const Grid = dynamic(
    () => {
        return import("../components/Grid");
    },
    { ssr: false }
);

export const Home: NextPage = () => {
    return (
        <div className={styles.container}>
            <main className={styles.main}>
                <h1 className={styles.title}>Hi</h1>
                <Grid />
            </main>
        </div>
    );
};

grid.tsx

import React from "react";
import DataEditor from "@glideapps/glide-data-grid";

export default function Grid() {
    return <DataEditor {...args} />;
}