cjs-size-grid

[![NPM](https://img.shields.io/npm/v/react-datasheet-grid.svg)](https://www.npmjs.com/package/react-datasheet-grid) ![npm bundle size](https://img.shields.io/bundlephobia/min/react-datasheet-grid) [![JavaScript Style Guide](https://img.shields.io/badge/co

Usage no npm install needed!

<script type="module">
  import cjsSizeGrid from 'https://cdn.skypack.dev/cjs-size-grid';
</script>

README

react-datasheet-grid

NPM 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 custom widgets
  • Blazing fast, optimized for speed
  • Smooth animations
  • Virtualized, 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'

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
      data={data}
      onChange={setData}
      columns={columns}
    />
  )
}