react-datasheet-grid

An Excel-like React component to create beautiful spreadsheets.

react-datasheet-grid downloads react-datasheet-grid version react-datasheet-grid license

react-datasheet-gridSimilar Packages:

Npm Package Weekly Downloads Trend

3 Years
🌟 Show real-time usage chart on react-datasheet-grid's README.md, just copy the code below.
## Usage Trend
[![Usage Trend of react-datasheet-grid](https://npm-compare.com/img/npm-trend/THREE_YEARS/react-datasheet-grid.png)](https://npm-compare.com/react-datasheet-grid#timeRange=THREE_YEARS)

Cumulative GitHub Star Trend

🌟 Show GitHub stars trend chart on react-datasheet-grid's README.md, just copy the code below.
## GitHub Stars Trend
[![GitHub Stars Trend of react-datasheet-grid](https://npm-compare.com/img/github-trend/react-datasheet-grid.png)](https://npm-compare.com/react-datasheet-grid)

Stat Detail

Package
Downloads
Stars
Size
Issues
Publish
License
react-datasheet-grid01,994312 kB6824 days agoMIT

README for react-datasheet-grid

react-datasheet-grid

GitHub Workflow Status Coveralls npm GitHub last commit npm bundle size JavaScript Style Guide

View demo and documentation

An Airtable-like / Excel-like component to create beautiful spreadsheets.

Preview

Feature rich:

  • Dead simple to set up and to use
  • Supports copy / pasting to and from Excel, Google-sheet...
  • Keyboard navigation and shortcuts fully-supported
  • Supports right-clicking and custom context menu
  • Supports dragging corner to expand selection
  • Easy to extend and implement custom widgets
  • Blazing fast, optimized for speed, minimal renders count
  • Smooth animations
  • Virtualized rows and columns, supports hundreds of thousands of rows
  • Extensively customizable, controllable behaviors
  • Built with Typescript

Install

npm i react-datasheet-grid

Usage

import {
  DataSheetGrid,
  checkboxColumn,
  textColumn,
  keyColumn,
} from 'react-datasheet-grid'

// Import the style only once in your app!
import 'react-datasheet-grid/dist/style.css'

const Example = () => {
  const [ data, setData ] = useState([
    { active: true, firstName: 'Elon', lastName: 'Musk' },
    { active: false, firstName: 'Jeff', lastName: 'Bezos' },
  ])

  const columns = [
    {
      ...keyColumn('active', checkboxColumn),
      title: 'Active',
    },
    {
      ...keyColumn('firstName', textColumn),
      title: 'First name',
    },
    {
      ...keyColumn('lastName', textColumn),
      title: 'Last name',
    },
  ]

  return (
    <DataSheetGrid
      value={data}
      onChange={setData}
      columns={columns}
    />
  )
}