react-spreadsheet

Simple, customizable yet performant spreadsheet for React

Github stars Tracking Chart

React Spreadsheet

Simple, customizable yet performant spreadsheet for React.

Screenshot
FOSSA Status
CircleCI
Known Vulnerabilities
Coverage Status

npm install react-spreadsheet

or

yarn add react-spreadsheet

Features

  • Simple straightforward API focusing on common use cases while keeping flexibility
  • Performant (yet not virtualized)
  • Implements Just Components™

Demo

Usage

Getting Started

import React from "react";
import Spreadsheet from "react-spreadsheet";

const data = [
  [{ value: "Vanilla" }, { value: "Chocolate" }],
  [{ value: "Strawberry" }, { value: "Cookies" }]
];

const MyComponent = () => <Spreadsheet data={data} />;

Custom Components

import React from "react";
import Spreadsheet from "react-spreadsheet";

const RangeView = ({ cell, getValue }) => (
  <input
    type="range"
    value={getValue({ data: cell })}
    disabled
    style={{ pointerEvents: "none" }}
  />
);

const RangeEdit = ({ getValue, cell, onChange }) => (
  <input
    type="range"
    onChange={e => {
      onChange({ ...cell, value: e.target.value });
    }}
    value={getValue({ data: cell }), 0}
    autoFocus
  />
);

const data = [
  [{ value: "Flavors" }],
  [({ value: "Vanilla" }, { value: "Chocolate" })],
  [{ value: "Strawberry" }, { value: "Cookies" }],
  [
    { value: "How much do you like ice cream?" },
    { value: 100, DataViewer: RangeView, DataEditor: RangeEdit }
  ]
];

const MyComponent = () => <Spreadsheet data={data} />;

Prior Art

  • React Datasheet - Heavily inspired by, enhanced performance and API, no formulas
  • React Spreadsheet Grid - Virtualized, lacks significant UI parts, no formulas
  • Handsonetable - Virtualized, lacks dynamic customization. React Spreadsheet uses it's formulas parsing module

License

FOSSA Status

Main metrics

Overview
Name With Owneriddan/react-spreadsheet
Primary LanguageTypeScript
Program languageJavaScript (Language Count: 3)
Platform
License:MIT License
所有者活动
Created At2018-02-18 17:12:32
Pushed At2025-03-30 04:44:09
Last Commit At2025-03-30 07:31:55
Release Count54
Last Release Namev0.10.1 (Posted on 2025-03-30 07:01:57)
First Release Namev0.4.44 (Posted on 2020-03-13 16:17:42)
用户参与
Stargazers Count1.5k
Watchers Count19
Fork Count175
Commits Count0.9k
Has Issues Enabled
Issues Count179
Issue Open Count14
Pull Requests Count130
Pull Requests Open Count18
Pull Requests Close Count32
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private