Skip to content

Powerful virtual data grid for ReactJs with advanced customization. Best features from excel plus incredible performance πŸ”‹

License

Notifications You must be signed in to change notification settings

revolist/react-datagrid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

React Data Grid minimalist adapter

React Data Grid

Latest Version on NPM Software License Dependency count Tree shaking Bundle size Sonar Quality Gate

Powerful React Data Grid component built on top of RevoGrid.

Support Millions of cells and thousands of columns easy and efficiently for fast data rendering. Easy to use.

Demo and API β€’ Key Features β€’ How To Use β€’ Installation β€’ Docs β€’ License

Material grid preview

RevoGrid material theme.

Key Features

⚠️ Note: Repository Notice: This repo is read-only. Create new issues at the revogrid repo

Installation

With NPM:

npm i @revolist/react-datagrid

With PNPM:

pnpm add @revolist/react-datagrid

With Yarn:

yarn add @revolist/react-datagrid

With Bun:

bun add @revolist/react-datagrid

Note

Previous package name: @revolist/revogrid-react was renamed to @revolist/react-datagrid.

Basic Usage

Simplest Usage

import { useState } from 'react'
import { RevoGrid } from '@revolist/react-datagrid'

/**
 * note: columns & source need a "stable" reference in order to prevent infinite re-renders
 */
const columns = [
  { prop: 'name', name: 'First' },
  { prop: 'details', name: 'Second' },
]

function App() {
  const [source] = useState([
    { name: '1', details: 'Item 1' },
    { name: '2', details: 'Item 2' },
  ]);
  return (<RevoGrid columns={columns} source={source} />)
}
export default App

Cell Template Usage

import { useState } from 'react';
import { RevoGrid, Template, type ColumnDataSchemaModel } from '@revolist/react-datagrid';

/**
 * Custom cell component
 */
const Cell = ({ model, prop, value }: ColumnDataSchemaModel) => {
  return <div><strong>{value}</strong></div>;
};
/**
 * note: columns & source need a "stable" reference in order to prevent infinite re-renders
 */
const columns = [
  { prop: 'name', name: 'First', cellTemplate: Template(Cell) },
];

function App() {
  const [source] = useState([{ name: '1' }, { name: '2' }]);
  return (<RevoGrid columns={columns} source={source} />)
}
export default App

Editor Usage

// App.tsx
import { useState } from 'react';
import { RevoGrid, Editor, type EditorType, type Editors } from '@revolist/react-datagrid';

/**
 * Custom editor component
 */
const Button = ({ close } : EditorType) => {
  return <button onClick={close}>Close</button>
};

const gridEditors: Editors = { ['custom-editor']: Editor(Button) };

/**
 * note: columns & source need a "stable" reference in order to prevent infinite re-renders
 */
const columns = [
  {
    prop: 'name',
    name: 'Custom editor',
    editor: 'custom-editor',
  },
];

function App() {
  const [source] = useState([
    { name: '1', details: 'Item 1' },
    { name: '2', details: 'Item 2' },
  ]);
  return (<RevoGrid columns={columns} source={source} editors={gridEditors} />)
}

export default App

Example and guide

Versions

  • 2.0+: Introduced the plugin system, grouping, sorting, and filtering.

  • 3.0+: Breaking changes introduced:

    • Removed the redundant viewport component.
    • Renamed classes to support Bootstrap and other libraries:
      • row -> rgRow
      • col -> rgCol
      • data-cell -> rgCell
      • data-header-cell -> rgHeaderCell
    • Migrated all method names to lowercase to align with modern event naming conventions. For example, afterEdit is now afteredit. Check the API for details.
    • Added support for pure ESM modules to enable the use of the grid in all modern frontend tooling like Vite, Parcel, etc. You can now import custom elements without lazy loading. Note that you are responsible for polyfills.
  • 4.0+: Breaking changes introduced. See the migration guide.

  • Redesigned type support: - Removed deprecated namespaces: - Before: RevoGrid.ColumnRegular - Now: ColumnRegular; - Improved type import: - Before: import { RevoGrid } from '@revolist/revogrid/dist/types/interfaces' - Now: import { ColumnRegular } from '@revolist/revogrid'. - Changed viewport type names everywhere. For example, before: rowDefinitions: [{ type: "row", index: 0, size: 145 }], after: rowDefinitions: [{ type: "rgRow", index: 0, size: 145 }].

    • Updated event naming convention. Review your event usage. Event names are all lowercase now and are aligned with modern event naming conventions. For example, afterEdit -> afteredit.
    • Multiple event breaking changes introduced: beforerowrender now returns BeforeRowRenderEvent. Check all events for details.
  • Major improvements:

    • Rethought the entire framework approach. Introduced Pro version with advance support and pro features.
    • Introduced slot support.
    • Updated scrolling system for better mobile support.
    • Advance template support. Introduced additionalData for templates and editors. Prop gives access to parent/root app context.
    • Redesigned the documentation.
    • Fixed major issues and significantly improved overall performance, making the grid multiple time faster.
    • Enhanced plugin support - now with full access to grid providers.
    • Updated documentation.
    • Provided full framework support and native render for Angular, React, Svelte and Vue.
  • What next?

Our Sponsors

We would like to extend our heartfelt gratitude to our sponsors for their generous support. Their contributions help us maintain and develop RevoGrid.

Altruistiq

Become a Sponsor

If you or your company would like to support the ongoing development of RevoGrid, please consider Sponsor Us or use a Pro version. Your support will help us continue to improve the project and provide the best possible tool for the community.

Thank you for supporting RevoGrid! πŸ™

Contributing

By getting involved, you'll have the opportunity to enhance your skills, gain valuable experience, and make a significant impact on an innovative project. Your contribution, no matter how big or small, is valuable.

Why Contribute?

  • Expand Your Knowledge: Working on complex libraries allows you to dive deep into modern web technologies, improve your coding skills, and learn best practices in performance optimization, data handling, and component-based architecture.
  • Experience: Contributing to an open-source project like provides you with practical experience that can be a great addition to your portfolio. It demonstrates your ability to work collaboratively, solve complex problems, and contribute to a project's success.
  • Professional Growth: By contributing, you become part of a network of talented developers. This can lead to mentorship opportunities, collaborations, and professional connections that can benefit your career.

License

MIT