Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

react-data-grid

adazzle937.4kMIT7.0.0-beta.52TypeScript support: included

Feature-rich and customizable data grid React component

react, data grid

readme

react-data-grid

npm-badge type-badge size-badge codecov-badge ci-badge

The DataGrid component is designed to handle large datasets efficiently while offering a rich set of features for customization and interactivity.

Features

Installation

to install react-data-grid, use npm or yarn:

npm install react-data-grid
# or
yarn add react-data-grid

Additionally, import the default styles in your application:

import 'react-data-grid/lib/styles.css';

react-data-grid is published as ECMAScript modules for evergreen browsers, bundlers, and server-side rendering.

Getting started

Here is a basic example of how to use react-data-grid in your React application:

import 'react-data-grid/lib/styles.css';

import { DataGrid } from 'react-data-grid';

const columns = [
  { key: 'id', name: 'ID' },
  { key: 'title', name: 'Title' }
];

const rows = [
  { id: 0, title: 'Example' },
  { id: 1, title: 'Demo' }
];

function App() {
  return <DataGrid columns={columns} rows={rows} />;
}

API Reference

Components

<DataGrid />

DataGridProps
columns: readonly Column<R, SR>[]

See Column.

An array of column definitions. Each column should have a key and name.

:warning: Passing a new columns array will trigger a re-render for the whole grid, avoid changing it as much as possible for optimal performance.

rows: readonly R[]

An array of rows, the rows data can be of any type.

topSummaryRows?: Maybe<readonly SR[]>

Rows pinned at the top of the grid for summary purposes.

bottomSummaryRows?: Maybe<readonly SR[]>

Rows pinned at the bottom of the grid for summary purposes.

rowKeyGetter?: Maybe<(row: R) => K>

Function to return a unique key/identifier for each row. rowKeyGetter is required for row selection to work.

import { DataGrid } from 'react-data-grid';

interface Row {
  id: number;
  name: string;
}

function rowKeyGetter(row: Row) {
  return row.id;
}

function MyGrid() {
  return <DataGrid columns={columns} rows={rows} rowKeyGetter={rowKeyGetter} />;
}

:bulb: While optional, setting this prop is recommended for optimal performance as the returned value is used to set the key prop on the row elements.

onRowsChange?: Maybe<(rows: R[], data: RowsChangeData<R, SR>) => void>

Callback triggered when rows are changed.

The first parameter is a new rows array with both the updated rows and the other untouched rows. The second parameter is an object with an indexes array highlighting which rows have changed by their index, and the column where the change happened.

import { useState } from 'react';
import { DataGrid } from 'react-data-grid';

function MyGrid() {
  const [rows, setRows] = useState(initialRows);

  return <DataGrid columns={columns} rows={rows} onRowsChange={setRows} />;
}
rowHeight?: Maybe<number | ((row: R) => number)>

Default: 35 pixels

Height of each row in pixels. A function can be used to set different row heights.

headerRowHeight?: Maybe<number>

Default: 35 pixels

Height of the header row in pixels.

summaryRowHeight?: Maybe<number>

Default: 35 pixels

Height of each summary row in pixels.

selectedRows?: Maybe<ReadonlySet<K>>

A set of selected row keys. rowKeyGetter is required for row selection to work.

isRowSelectionDisabled?: Maybe<(row: NoInfer<R>) => boolean>

Function to determine if row selection is disabled for a specific row.

onSelectedRowsChange?: Maybe<(selectedRows: Set<K>) => void>

Callback triggered when the selection changes.

import { useState } from 'react';
import { DataGrid, SelectColumn } from 'react-data-grid';

const rows: readonly Rows[] = [...];

const columns: readonly Column<Row>[] = [
  SelectColumn,
  // other columns
];

function MyGrid() {
  const [selectedRows, setSelectedRows] = useState((): ReadonlySet<number> => new Set());

  return (
    <DataGrid
      rowKeyGetter={rowKeyGetter}
      columns={columns}
      rows={rows}
      selectedRows={selectedRows}
      isRowSelectionDisabled={isRowSelectionDisabled}
      onSelectedRowsChange={setSelectedRows}
    />
  );
}

function rowKeyGetter(row: Row) {
  return row.id;
}

function isRowSelectionDisabled(row: Row) {
  return !row.isActive;
}
sortColumns?: Maybe<readonly SortColumn[]>

An array of sorted columns.

onSortColumnsChange?: Maybe<(sortColumns: SortColumn[]) => void>

Callback triggered when sorting changes.

import { useState } from 'react';
import { DataGrid, SelectColumn } from 'react-data-grid';

const rows: readonly Rows[] = [...];

const columns: readonly Column<Row>[] = [
  {
    key: 'name',
    name: 'Name',
    sortable: true
  },
  // other columns
];

function MyGrid() {
  const [sortColumns, setSortColumns] = useState<readonly SortColumn[]>([]);

  return (
    <DataGrid
      columns={columns}
      rows={rows}
      sortColumns={sortColumns}
      onSortColumnsChange={setSortColumns}
    />
  );
}

Grid can be sorted on multiple columns using ctrl (command) + click. To disable multiple column sorting, change the onSortColumnsChange function to

onSortColumnsChange(sortColumns: SortColumn[]) {
  setSortColumns(sortColumns.slice(-1));
}
defaultColumnOptions?: Maybe<DefaultColumnOptions<R, SR>>

Default options applied to all columns.

function MyGrid() {
  return (
    <DataGrid
      columns={columns}
      rows={rows}
      defaultColumnOptions={{
        minWidth: 100,
        resizable: true,
        sortable: true,
        draggable: true
      }}
    />
  );
}
onFill?: Maybe<(event: FillEvent<R>) => R>
onCellClick?: Maybe<(args: CellClickArgs<R, SR>, event: CellMouseEvent) => void>

Callback triggered when a cell is clicked. The default behavior is to select the cell. Call preventGridDefault to prevent the default behavior

function onCellClick(args: CellClickArgs<R, SR>, event: CellMouseEvent) {
  if (args.column.key === 'id') {
    event.preventGridDefault();
  }
}

<DataGrid rows={rows} columns={columns} onCellClick={onCellClick} />;

This event can be used to open cell editor on single click

function onCellClick(args: CellClickArgs<R, SR>, event: CellMouseEvent) {
  if (args.column.key === 'id') {
    event.preventGridDefault();
    args.selectCell(true);
  }
}

Arguments:

args: CellClickArgs<R, SR>

  • args.rowIdx: number - row index of the currently selected cell
  • args.row: R - row object of the currently selected cell
  • args.column: CalculatedColumn<TRow, TSummaryRow> - column object of the currently selected cell
  • args.selectCell: (enableEditor?: boolean) => void - function to manually select the cell and optionally pass true to start editing

event extends React.MouseEvent<HTMLDivElement>

  • event.preventGridDefault:: () => void
  • event.isGridDefaultPrevented: boolean
onCellDoubleClick?: Maybe<(args: CellClickArgs<R, SR>, event: CellMouseEvent) => void>

Callback triggered when a cell is double-clicked. The default behavior is to open the editor if the cell is editable. Call preventGridDefault to prevent the default behavior

function onCellDoubleClick(args: CellClickArgs<R, SR>, event: CellMouseEvent) {
  if (args.column.key === 'id') {
    event.preventGridDefault();
  }
}

<DataGrid rows={rows} columns={columns} onCellDoubleClick={onCellDoubleClick} />;
onCellContextMenu?: Maybe<(args: CellClickArgs<R, SR>, event: CellMouseEvent) => void>

Callback triggered when a cell is right-clicked. The default behavior is to select the cell. Call preventGridDefault to prevent the default behavior

function onCellContextMenu(args: CellClickArgs<R, SR>, event: CellMouseEvent) {
  if (args.column.key === 'id') {
    event.preventGridDefault();
  }
}

<DataGrid rows={rows} columns={columns} onCellContextMenu={onCellContextMenu} />;
onCellKeyDown?: Maybe<(args: CellKeyDownArgs<R, SR>, event: CellKeyboardEvent) => void>

A function called when keydown event is triggered on a cell. This event can be used to customize cell navigation and editing behavior.

Examples

  • Prevent editing on Enter
function onCellKeyDown(args: CellKeyDownArgs<R, SR>, event: CellKeyboardEvent) {
  if (args.mode === 'SELECT' && event.key === 'Enter') {
    event.preventGridDefault();
  }
}
  • Prevent navigation on Tab
function onCellKeyDown(args: CellKeyDownArgs<R, SR>, event: CellKeyboardEvent) {
  if (args.mode === 'SELECT' && event.key === 'Tab') {
    event.preventGridDefault();
  }
}

Check more examples

onCellCopy?: Maybe<(args: CellCopyEvent<NoInfer<R>, NoInfer<SR>>, event: CellClipboardEvent) => void>

Callback triggered when a cell's content is copied.

onCellPaste?: Maybe<(args: CellPasteEvent<NoInfer<R>, NoInfer<SR>>, event: CellClipboardEvent) => void>

Callback triggered when content is pasted into a cell.

onSelectedCellChange?: Maybe<(args: CellSelectArgs<R, SR>) => void>;

Triggered when the selected cell is changed.

Arguments:

  • args.rowIdx: number - row index
  • args.row: R - row object of the currently selected cell
  • args.column: CalculatedColumn<TRow, TSummaryRow> - column object of the currently selected cell
onScroll?: Maybe<(event: React.UIEvent<HTMLDivElement>) => void>

Callback triggered when the grid is scrolled.

onColumnResize?: Maybe<(column: CalculatedColumn<R, SR>, width: number) => void>

Callback triggered when column is resized.

onColumnsReorder?: Maybe<(sourceColumnKey: string, targetColumnKey: string) => void>

Callback triggered when columns are reordered.

enableVirtualization?: Maybe<boolean>

Default: true

This prop can be used to disable virtualization.

renderers?: Maybe<Renderers<R, SR>>

Custom renderers for cells, rows, and other components.

interface Renderers<TRow, TSummaryRow> {
  renderCell?: Maybe<(key: Key, props: CellRendererProps<TRow, TSummaryRow>) => ReactNode>;
  renderCheckbox?: Maybe<(props: RenderCheckboxProps) => ReactNode>;
  renderRow?: Maybe<(key: Key, props: RenderRowProps<TRow, TSummaryRow>) => ReactNode>;
  renderSortStatus?: Maybe<(props: RenderSortStatusProps) => ReactNode>;
  noRowsFallback?: Maybe<ReactNode>;
}

For example, the default <Row /> component can be wrapped via the renderRow prop to add contexts or tweak props

import { DataGrid, RenderRowProps, Row } from 'react-data-grid';

function myRowRenderer(key: React.Key, props: RenderRowProps<Row>) {
  return (
    <MyContext key={key} value={123}>
      <Row {...props} />
    </MyContext>
  );
}

function MyGrid() {
  return <DataGrid columns={columns} rows={rows} renderers={{ renderRow: myRowRenderer }} />;
}

:warning: To prevent all rows from being unmounted on re-renders, make sure to pass a static or memoized component to renderRow.

rowClass?: Maybe<(row: R, rowIdx: number) => Maybe<string>>

Function to apply custom class names to rows.

import { DataGrid } from 'react-data-grid';

function MyGrid() {
  return <DataGrid columns={columns} rows={rows} rowClass={rowClass} />;
}

function rowClass(row: Row, rowIdx: number) {
  return rowIdx % 2 === 0 ? 'even' : 'odd';
}
headerRowClass?: Maybe<string>>

Custom class name for the header row.

direction?: Maybe<'ltr' | 'rtl'>

This property sets the text direction of the grid, it defaults to 'ltr' (left-to-right). Setting direction to 'rtl' has the following effects:

  • Columns flow from right to left
  • Frozen columns are pinned on the right
  • Column resize handle is shown on the left edge of the column
  • Scrollbar is moved to the left
className?: string | undefined

Custom class name for the grid.

style?: CSSProperties | undefined

Custom styles for the grid.

'aria-label'?: string | undefined

The label of the grid. We recommend providing a label using aria-label or aria-labelledby

'aria-labelledby'?: string | undefined

The id of the element containing a label for the grid. We recommend providing a label using aria-label or aria-labelledby

'aria-description'?: string | undefined
'aria-describedby'?: string | undefined

If the grid has a caption or description, aria-describedby can be set on the grid element with a value referring to the element containing the description.

'data-testid'?: Maybe<string>

This prop can be used to add a testid for testing. We recommend using role and name to find the grid element

function MyGrid() {
  return <DataGrid aria-label="my-grid" columns={columns} rows={rows} />;
}

function MyGridTest() {
  const grid = screen.getByRole('grid', { name: 'my-grid' });
}

<TreeDataGrid />

TreeDataGrid is component built on top of DataGrid to add row grouping. This implements the Treegrid pattern. At the moment TreeDataGrid does not support onFill and isRowSelectionDisabled props

TreeDataGridProps
groupBy?: Maybe<readonly string[]>
rowGrouper?: Maybe<(rows: readonly R[], columnKey: string) => Record<string, readonly R[]>>
expandedGroupIds?: Maybe<ReadonlySet<unknown>>
onExpandedGroupIdsChange?: Maybe<(expandedGroupIds: Set<unknown>) => void>
groupIdGetter?: Maybe<(groupKey: string, parentId?: string) => string>

<TextEditor />

Props

See RenderEditCellProps

<Row />

See renderers

Props

See RenderRowProps

The ref prop is supported.

<SortableHeaderCell />

Props
onSort: (ctrlClick: boolean) => void
sortDirection: SortDirection | undefined
priority: number | undefined
tabIndex: number
children: React.ReactNode

<ValueFormatter />

Props

See FormatterProps

<SelectCellFormatter />

Props
value: boolean
tabIndex: number
disabled?: boolean | undefined
onChange: (value: boolean, isShiftClick: boolean) => void
onClick?: MouseEventHandler<T> | undefined
'aria-label'?: string | undefined
'aria-labelledby'?: string | undefined

<ToggleGroupFormatter />

Props

See RenderGroupCellProps

Hooks

useHeaderRowSelection<R>(): { isIndeterminate, isRowSelected, onRowSelectionChange }

useRowSelection<R>(): { isRowSelectionDisabled, isRowSelected, onRowSelectionChange }

Other

SelectColumn: Column<any, any>

SELECT_COLUMN_KEY = 'rdg-select-column'

Types

Column

name: string | ReactElement

The name of the column. Displayed in the header cell by default.

key: string

A unique key to distinguish each column

width?: Maybe<number | string>

Default auto

Width can be any valid css grid column value. If not specified, it will be determined automatically based on grid width and specified widths of other columns.

width: 80; // pixels
width: '25%';
width: 'max-content';
width: 'minmax(100px, max-content)';

max-content can be used to expand the column to show all the content. Note that the grid is only able to calculate column width for visible rows.

minWidth?: Maybe<number>

Default: 50 pixels

Minimum column width in pixels.

maxWidth?: Maybe<number>

Maximum column width in pixels.

cellClass?: Maybe<string | ((row: TRow) => Maybe<string>)>

Class name(s) for the cell

headerCellClass?: Maybe<string>

Class name(s) for the header cell.

summaryCellClass?: Maybe<string | ((row: TSummaryRow) => Maybe<string>)>

Class name(s) for the summary cell.

renderCell?: Maybe<(props: RenderCellProps<TRow, TSummaryRow>) => ReactNode>

Render function to render the content of cells.

renderHeaderCell?: Maybe<(props: RenderHeaderCellProps<TRow, TSummaryRow>) => ReactNode>

Render function to render the content of the header cell.

renderSummaryCell?: Maybe<(props: RenderSummaryCellProps<TSummaryRow, TRow>) => ReactNode>

Render function to render the content of summary cells

renderEditCell?: Maybe<(props: RenderEditCellProps<TRow, TSummaryRow>) => ReactNode>

Render function to render the content of edit cells. When set, the column is automatically set to be editable

editable?: Maybe<boolean | ((row: TRow) => boolean)>

Enables cell editing. If set and no editor property specified, then a textinput will be used as the cell editor.

colSpan?: Maybe<(args: ColSpanArgs<TRow, TSummaryRow>) => Maybe<number>>
frozen?: Maybe<boolean>

Default: false

Determines whether column is frozen. Frozen columns are pinned on the left. At the moment we do not support pinning columns on the right.

resizable?: Maybe<boolean>

Default: false

Enable resizing of the column

sortable?: Maybe<boolean>

Default: false

Enable sorting of the column

draggable?: Maybe<boolean>

Default: false

Enable dragging of the column

sortDescendingFirst?: Maybe<boolean>

Default: false

Sets the column sort order to be descending instead of ascending the first time the column is sorted

editorOptions

Options for cell editing.

displayCellContent?: Maybe<boolean>

Default: false

Render the cell content in addition to the edit cell. Enable this option when the editor is rendered outside the grid, like a modal for example.

commitOnOutsideClick?: Maybe<boolean>

Default: true

Commit changes when clicking outside the cell.

closeOnExternalRowChange?: Maybe<boolean>

Default: true

Close the editor when the row changes externally.

DataGridHandle

RenderEditCellProps

RenderCellProps

RenderGroupCellProps

RenderRowProps

Generics

  • R, TRow: Row type
  • SR, TSummaryRow: Summary row type
  • K: Row key type

changelog

Changelog

v7.0.0-canary.48

  • Fixed an edge case where clicking outside the grid wouldn't close and commit an open editor quickly enough, resulting in the previous rows state being used by parent components in click handlers. (PR)
  • Support for filters has been removed, along with: (PR)
    • The <DataGrid /> props: headerFiltersHeight, filters, onFiltersChange, enableFilterRow
    • Column.filterRenderer
    • The exports: FilterRendererProps, Filters
  • Optional Column props can now also be null in addition to undefined. (PR)

v7.0.0-canary.47

  • Added a third, optional generic on <DataGrid /> to specify the row key type. (PR)
  • Added the useRowSelection hook for custom cell renderers to access isRowSelected and onRowSelectionChange. (PR)
  • HeaderRendererProps.allRowsSelected tweaks, affecting the SelectColumn: (PR)
    • It will now be false when rows.length === 0 instead of true.
    • selectedRows must contain all the row keys for allRowsSelected to be true, instead of naively comparing the size and length.
  • Optional props on <DataGrid /> can now also be null in addition to undefined. (PR)

v7.0.0-canary.46

  • Optimize onRowsChange: only update changed rows (PR)

v7.0.0-canary.45

  • Fixed issue where the scrollbars would flicker in edge cases (PR)

v7.0.0-canary.44

  • Use aria-selected to style selected cell/rows (PR)
  • Add support for variable row heights (PR)

v7.0.0-canary.43

  • Fix aria-readonly (PR)

v7.0.0-canary.42

  • Add missing aria-colspan (PR)
  • Add aria-readonly to readonly cells (PR)

v7.0.0-canary.41

  • Fix summary row colSpan (PR)
  • HeaderCell: Add missing event parameter to onPointerUp, fix #2305 (PR)

v7.0.0-canary.40

  • Add column.colSpan prop to merge cells (PR)
  • Removed prefixed css properties from the generated style file (PR)

v7.0.0-canary.39

  • Add enableVirtualization prop (PR). Grid renders all the rows/columns when it is set to false.

v7.0.0-canary.38

  • Fix summary row position (PR)

v7.0.0-canary.37

  • Add summaryRowHeight prop (PR)
  • Rollup type definitions (PR)

v7.0.0-canary.36

  • Fixed column headers not showing when grid is horizontally scrolled (PR)

v7.0.0-canary.35

  • Migrate to css-in-js with linaria (PR). RDG now internally uses linaria to manage styles. The stylesheets are automatically injected and there is no stylesheet to manually import anymore.
  • Expose data grid root element reference (PR).
  • (Bug fix) Tabbing into the grid should initiate keyboard navigation (PR).

v7.0.0-canary.34

  • Only show the vertical scrollbar when necessary (PR)
  • Fix editorPortalTarget default value for server-side rendering (PR)
  • Use grid layout for rows, split column metrics from compute columns (PR). Resizing columns no longer recreates columns so less re-renders
  • Augment onRowsChange with indexes and column data (PR)

v7.0.0-canary.33

  • (Bug) Commit changes before exiting grid (PR)

v7.0.0-canary.32

  • Fix importing rdg with webpack 4 (PR)

v7.0.0-canary.31

  • (Breaking) Remove some exports from the grid (PR)
  • Use a pseudo-element for header resizer (PR)
  • (new) Formatters now receive a new onRowChange prop (PR)
  • (new) Change column.name type from string to string/ReactElement (PR)
  • Publish bundles instead of modules, use babel only for transpilation (PR)
  • Use the new jsx runtime (PR). The minimum supported react version is 16.14 now.

v7.0.0-canary.30

  • Forward sorting props to headerRenderer (PR)
  • Disable cell navigation while editing. This behavior can be controlled using the new column.editorOptions.onNavigation option (PR)

v7.0.0-canary.29

  • Fix crash when rows are undefined (PR)
  • Fix a scrolling bug caused by scroll-behavior: smooth (PR)

v7.0.0-canary.28

  • (Breaking) Removed onRowsUpdate, enableCellCopyPaste, and enableCellDragAndDrop props. Added 2 new props (onFill and onPaste) (PR)
  • (Breaking) Rename enableFilters to enableFilterRow (PR)

v7.0.0-canary.27

  • (Breaking) Removed old editor API (PR)
  • (Breaking) Removed onCheckCellIsEditable prop (PR). Use column.editable instead. = (Breaking) Replaced rowKey prop with rowKeyGetter (PR)

v7.0.0-canary.26

  • Fixed Copy & Paste events not working properly in non-English keyboards (PR)

v7.0.0-canary.25

  • Added support for webpack 5 (PR)

v7.0.0-canary.24

  • Fixed a bug where grid was getting scrolled on cell focus

v7.0.0-canary.23

  • Minor style fixes

v7.0.0-canary.22

  • Add Grouping (PR). Check the new example.
  • (Breaking) Removed height and width props and added new className and style props. We are now using ResizeObserver to calculate all the grid dimensions (PR)
  • (Breaking) Removed formatterOptions. Grid now handles formatter focus internally so this prop is no longer required (PR)
  • Added support for React 17

v7.0.0-canary.21

  • Editor2 bug fixes (PR)
  • formatterOptions.focusable can be a function now so different rows can have different focus behavior for the same column
  • Grid now internally uses ResizeObserver API to calculate the available width (PR)

v7.0.0-canary.20

  • A new editor api that does not require a ref (PR)
  • A new columnDefaultOptions prop. This replaces minColumnWidth and defaultFormatter props (PR)

v7.0.0-canary.19

  • Allow setting ref on Cell/Row renderers (PR)

v7.0.0-canary.18

  • Accessibility improvements. Added various aria attributes. (PR)
  • Removed enableCellAutoFocus prop (PR)
  • Removed InteractionMasks component. This is an internal change to prepare for grouping and it fixes a few selected cell position bugs
  • Improved focus for custom formatters using the new formatterOptions (PR)

v7.0.0-canary.17

  • Performance improvements (PR)
  • A new rowClass prop (PR)

alpha to canary

  • Added:
    • Props:
      • className
      • style
      • onRowsChange
      • onFill
      • onPaste
      • onSelectedCellChange
        • ⚠️ This replaces the onCellSelected and onCellDeSelected props
      • enableFilterRow
        • ⚠️ This replaces the enableHeaderFilters and column.filterable props
      • filters
      • onFiltersChange
      • rows
        • ⚠️ This replace the rowGetter and rowsCount props
      • rowClass
      • defaultColumnOptions
        • ⚠️ This replaces the minColumnWidth and defaultFormatter props
      • groupBy
      • rowGrouper
    • column.cellClass(row) function support:
      • column = { ..., cellClass(row) { return string; } }
    • column.minWidth
    • column.maxWidth
    • column.headerCellClass
    • column.editor
      • New API
    • column.editorOptions
    • column.groupFormatter
    • scrollToRow method
      • ⚠️ This replaces the scrollToRowIndex prop
    • Dark mode support
      • Dark mode is automatically applied following user preference
      • Light and dark modes can be forced by setting the rdg-light or rdg-dark class names.
  • Removed:
    • Support:
      • ⚠️ IE11
    • Packages:
      • ⚠️ react-data-grid-addons
    • Props:
      • ⚠️ width
      • ⚠️ height
      • ⚠️ cellContentRenderer
      • ⚠️ contextMenu
      • ⚠️ enableCellSelect
      • ⚠️ enableCellAutoFocus
      • ⚠️ getValidFilterValues
      • ⚠️ onCellCopyPaste
      • ⚠️ onSelectedCellRangeChange
      • ⚠️ onCheckCellIsEditable
        • Use column.editable instead.
      • ⚠️ onGridKeyDown
      • ⚠️ onGridKeyUp
      • ⚠️ onRowDoubleClick
      • ⚠️ onRowsUpdate
        • Use onRowsChange, onFill, and onPaste instead.
      • ⚠️ onHeaderDrop
      • ⚠️ draggableHeaderCell
        • Check #2007 on how to migrate
      • ⚠️ rowGroupRenderer
      • ⚠️ onRowExpandToggle
        • Check #2012 on how to migrate
      • ⚠️ rowsContainer
      • ⚠️ Subrow props: getSubRowDetails, onCellExpand, onDeleteSubRow, and onAddSubRow
        • Check #1853 on how to migrate
      • ⚠️ cellMetaData (from Row and Cell props)
      • ⚠️ value (from column.formatter props)
    • Ref handlers:
      • ⚠️ openCellEditor, use selectCell instead.
    • ⚠️ React elements are no longer supported, please use components instead.
      • For example: `diff const column = { key: 'example', name: 'Example',
      • formatter: <CustomFormatter length={5} />
      • formatter: (props) => <CustomFormatter {...props} length={5} /> }; `
    • ⚠️ column.events
    • ⚠️ column.getCellActions
      • Check #1845 on how to migrate
    • ⚠️ column.getRowMetaData
    • ⚠️ column.minColumnWidth
    • ⚠️ column.filterable
    • ⚠️ column.draggable
    • ⚠️ cellRangeSelection.{onStart,onUpdate,onEnd}
    • ⚠️ fromRowId, toRowId, and fromRowData from onRowsUpdate argument
    • ⚠️ Stopped exporting HeaderCell
  • Renamed:
    • ⚠️ minHeight to height
    • ⚠️ minWidth to width
    • ⚠️ onGridSort to onSort
    • ⚠️ emptyRowsView to emptyRowsRenderer
    • ⚠️ rowKey to rowKeyGetter
    • ⚠️ rowData to row
    • ⚠️ fromRowData to fromRow
    • ⚠️ idx to rowIdx in Row renderer
  • Changed:
    • ⚠️ Started publishing ES2019/ESM modules instead of ES5/CommonJS modules.
      • Using @babel/preset-env with core-js is recommended to enable compatibility for the browsers your project aims to support.
    • ⚠️ Improved support for summary rows:
      • summaryRows types are now independent from rows
      • Added column.summaryCellClass and column.summaryFormatter props
      • column.formatter isn't used anymore to render summary row cells.
    • Only visible headers cells are now rendered. #1837
    • ⚠️ the rowKeyGetter prop is now required for row selection.
    • ⚠️ column.cellClass does not affect header cells anymore.
    • ⚠️ onScroll will directly pass the UIEvent rather than the scrollLeft and scrollRight only.
    • ⚠️ The stylesheets are now automatically injected, there is no stylsheet to manually import anymore.

main to alpha

  • Added:
    • TypeScript declaration files
    • column.cellContentRenderer
      • More info in this gist
    • summaryRows prop #1773
    • sortColumn and sortDirection props
      • ⚠️ The internal sort states have been removed.
      • Check #1768 on how to migrate.
    • selectedRows and onSelectedRowsChange props
      • ⚠️ Row selection has been reimplemented.
      • A new SelectColumn is now available to import and add a row selection column.
      • Check #1762 on how to migrate.
  • Removed:
    • Packages:
      • react-data-grid-examples
        • Use the website as reference, or clone the repo locally and run npm install + npm start
    • Props:
      • ⚠️ onCellsDragged
      • ⚠️ onDragHandleDoubleClick
      • ⚠️ onRows
      • ⚠️ onRowUpdated
      • ⚠️ rowScrollTimeout
      • ⚠️ toolbar
        • Check #1769 on how to migrate
      • ⚠️ isScrolling (from column.formatter props)
    • ⚠️ ContainerEditorWrapper
    • ⚠️ EditorBase
    • ⚠️ setScrollLeft from Row and Cell renderers
      • setScrollLeft instance method was previously required on custom Cell and Row renderers and it can be safely removed now.
      • More info in #1793
    • ⚠️ Dropped ImmutableJS support.
    • ⚠️ Dropped dynamic height row support.
      • This was not officially supported, but it was still possible to implement dynamic rows via custom Row renderer. This was a buggy feature so it has been removed.
    • ⚠️ Removed row reordering support.
  • Renamed:
    • ReactDataGrid to DataGrid
  • Changed:
    • ⚠️ The stylesheets are now bundled separately:
      • react-data-grid/dist/react-data-grid.css
    • ⚠️ Reimplemented stylesheets, renamed various class names #1780
      • No longer depends on bootstrap
    • Resizing a column now immediately resizes all its cells instead of just its header.
    • Improved performance across the board.

react-data-grid-addons

  • ⚠️ react-data-grid-addons has no default export anymore
    • Use import * as DataGridAddons from 'react-data-grid-addons'; instead
  • ⚠️ The stylesheets are now bundled separately:
    • react-data-grid-addons/dist/react-data-grid-addons.css
  • Removed:
    • ⚠️ AutoComplete editor
    • ⚠️ Utils

5.0.5 (Dec 6, 2018)

  • Bugfix: fix: draggable resizing col jumps to right (1421)
  • Bugfix: Cell Tooltip - Focus Issues (1422)

6.0.1 (Nov 30, 2018)

  • Bugfix: Fix formatter exports (1409)

6.0.0 (Nov 30, 2018)

  • Bugfix: Fix outside click logic for committing changes (1404)
  • TechDebt Add ESLint Rules (1396 1397 1396 1399)
  • TechDebt: Upgrade build tools to latest versions (1350)
  • Feature: Cleanup zIndex logic (1393)
  • Breaking Use react portals for cell editors (1369)
  • TechDebt: Upgrade build tools to latest versions (1350)

5.0.4 (Nov 14, 2018)

  • Bugfix: Custom Formatters Example - Styling Fix (1364)
  • Bugfix: Fix website publishing and remove ImmutableJS dependency (1366)
  • Bugfix: Remove react-data-grid dependency from the addons package (1354)
  • Bugfix: Fix drag fill in IE 11 (1359)
  • Bugfix: Ensure webpack uses correct common js external ref (1370)
  • Feature: Move DropTargetRowContainer static styles to CSS class for user customization (1308)
  • Bugfix: Replace use of i for column index which is no longer passed in (1344)
  • Bugfix: Remove utils from documentation as an exported module (1374)
  • TechDebt: Upgrade eslint packages (1376)
  • Bugfix: Cleanup DraggableContainer and fix styles (1379)

5.0.3 (Nov 1, 2018)

  • Bugfix: Fix frozen-columns source url (1355)
  • TechDebt: Defining the ref callback as a bound method (1353)
  • Bugfix: Fix cell focusing logic (1352)
  • Bugfix: RDG Tree Cell Expand Styling Issues (1316)

5.0.2 (Oct 30, 2018)

  • Bugfix: Fix grouping example (1311)
  • Bugfix: Remove contain layout css (1346)
  • Bugfix: Preserve window scroll position on cell selection (1349)

5.0.1 (Oct 22, 2018)

React-Data-Grid

  • Bugfix: Fix CopyMask columns (1289)

5.0.0 (Oct 22, 2018)

React-Data-Grid

  • Feature: Improve Cell navigation Performance (1123)
  • Feature: Scrolling improvements (1254)
  • Feature: Remove react-data-grid dependency from react-data-grid-addons bundle (1272)

4.0.8 (May 10, 2018)

React-Data-Grid

  • Bugfix: Fix editor refs (#1183)

4.0.7 (April 19, 2018)

React-Data-Grid

  • Feature: Support React v16 (#1116)
  • Feature: Set sort column and direction with props (#649)
  • Bugfix: Filtering should ignore null values (#1147)
  • Bugfix: Resize column doesnt work on firefox when also draggable (#1121)

React-Data-Grid-Addons

  • Breaking: Migrate to react-context-menu 2.9.2 (#1081)