Retour au classement

ruilisi/fortune-sheet

TypeScriptruilisi.github.io/fortune-sheet-docs/

A drop-in javascript spreadsheet library that provides rich features like Excel and Google Sheets

exceljavascriptreactspreadsheetxlsxcollaborativetypescriptdatagrid
Croissance des étoiles
Étoiles
3.7k
Forks
313
Croissance hebdomadaire
Issues
73
1k2k3k
mars 2022août 2023févr. 2025juil. 2026
Artefactsnpmnpm install fortune-sheet
README

FortuneSheet

FortuneSheet is a drop-in javascript spreadsheet library that provides rich features like Excel and Google Sheets

CircleCI Status Known Vulnerabilities Build with father xiemala

English | 简体中文

Purpose

The goal of FortuneSheet is to make a feature-rich, easy-to-configure online spreadsheet that you can use out-of-the-box.

This project is originated from Luckysheet and has inherited many code from it. Lots of efforts have done to translate the whole project to typescript (still in progress), and solved problems in the design of the original project.

We aim to make FortuneSheet powerful yet easy to maintain.

Communication

Live demo

Note: Some part of Storybook is outdated

Take a look at the live demo at fortune-sheet-demo.

Attention

Before stable release of 1.0, input data structure and APIs may change during development. If you encounter errors after upgrading a version, check Changelog and Migration Guide.

Improvements to Luckysheet

  • Written fully in typescript.
  • You can now use import / require to use the library.
    import { Workbook } from '@fortune-sheet/react'
    
  • Multiple instance on the same page is supported.
  • Dropped jQuery dependency, uses native React / Vue + immer to manage the dom and state.
  • Changed to a forked handsontable/formula-parser to handle formula calculations.
  • Optimized the dom structure.
  • Replaced icons from iconfont with SVGs, as iconfont icons are inconvenient to update for other maintainers.
  • No visible elements is created outside container.
  • Never stores data in the window object.

Features

  • Data structure is mostly compatible with Luckysheet (see Migration Guide).
  • Formatting: style, text alignment and rotation, text truncation, overflow, automatic line wrapping, multiple data types, cell segmentation style, hyperlink
  • Cells: multiple selection, borders, fill, merge cells
  • Row & column: insert, delete, hide, sort and filter rows or columns
  • Operation: copy, paste, cut, hot keys
  • Formulas & Functions: Built-in formulas
  • Import/export Excel: plugin for .xlsx import and export
  • Additional features: supports images, comments, data verification and custom tools

Roadmap

  • ✅ Support cooperative editing with backend storage.
  • ✅ Support undo/redo.
  • ✅ Mobile adaption.
  • ✅ Expose APIs.
  • ✅ Add tests.
  • More basic features:
    • ✅ fill handle
    • ✅fonts
    • ✅ format painter
    • ✅ comments
    • ✅ insert images
    • ✅ more toolbar buttons
  • Excel import and export plugin
  • Support Vue
  • More features:
    • ✅ sort
    • ✅ filter
    • ✅ hooks
    • ✅ conditional formatting
    • ✅ drag and drop
    • ✅ find and replace
    • ✅ data verification
    • ✅ freeze
    • ✅ hide, and split text
    • location
  • More advanced features:
    • ✅ screenshots
    • pivot tables
    • charts

Documentation

Note: Some topics in documentation is outdated

See detailed documentation at fortune-sheet-doc.

Get started (react)

Download and install the library

Using npm
npm install @fortune-sheet/react
Using pnpm
pnpm install @fortune-sheet/react
Using yarn
yarn add @fortune-sheet/react

Create an HTML placeholder

<style>
  html, body, #root {
    width: 100%;
    height: 100%;
  }
</style>
<div id="root"></div>

NOTE: width and height doesn't have to be 100%, but should at least have a value. If set to auto, table area may not show.

Render the sheet

import React from 'react';
import ReactDOM from 'react-dom';
import { Workbook } from "@fortune-sheet/react";
import "@fortune-sheet/react/dist/index.css"

ReactDOM.render(
  <Workbook data={[{ name: "Sheet1" }]} />,
  document.getElementById('root')
);

Backend storage and collabration

Each time a user operates on the sheet, an array of Op will be emiited through onOp callback. An op describes how to modify the current data to reach the new data after the user's operation. For example, here is an op when user sets the cell font to be bold on cell A2.

[
    {
        "op": "replace",
        "index": "0",
        "path": ["data", 1, 0, "bl"],
        "value": 1
    }
]

The op is useful for database modification and syncing state in online collabration.

A working example with Express (backend server) and MongoDB (data persistence) is avaiable in backend-demo folder.

Run it with node index.js and visit Collabration example (initialize data by visiting http://localhost:8081/init)

For detailed doc about Op, refer to fortune-sheet-doc

Migrating data from Luckysheet

The overall data structure of FortuneSheet is the same as Luckysheet, with some naming differences:

  1. sheet.index -> sheet.id
  2. sheet.calcChain[].id -> sheet.calcChain[].id

Contributing

Expected workflow is: Fork -> Patch -> Push -> Pull Request

Please make sure to read the Contributing Guide before making a pull request.

Development

Installation

yarn

Development

yarn dev

Packaging

yarn build

License

This project is licensed under the MIT License. See MIT for the full license text.

Dépôts similaires
SheetJS/sheetjs

📗 SheetJS Spreadsheet Data Toolkit -- New home https://git.sheetjs.com/SheetJS/sheetjs

Apache License 2.0xlsxexcel
sheetjs.com
36.3k7.9k
alibaba/easyexcel

快速、简洁、解决大文件内存溢出的java处理Excel工具

JavaMavenApache License 2.0excelpoi
easyexcel.opensource.alibaba.com
33.7k7.6k
handsontable/handsontable

JavaScript Data Grid / Data Table with a Spreadsheet Look & Feel. Works with React, Angular, and Vue. Supported by the Handsontable team ⚡

JavaScriptnpmOtherexcelcrud-operations
handsontable.com/docs
22k3.2k
qax-os/excelize

Go language library for reading and writing Microsoft Excel™ (XLAM / XLSM / XLSX / XLTM / XLTX) spreadsheets

GoGo ModulesBSD 3-Clause "New" or "Revised" Licensexlsxexcel
xuri.me/excelize
20.8k1.9k
iOfficeAI/OfficeCLI

OfficeCLI is the first and best Office suite purpose-built for AI agents to read, edit, and automate Word, Excel, and PowerPoint files. Free, open-source, single binary, no Office installation required.

C#Apache License 2.0agentai
officecli.ai
20.7k1.4k
dream-num/Luckysheet

Luckysheet upgraded to Univer

JavaScriptnpmMIT Licensespreadsheetjavascript
github.com/dream-num/univer/
16.7k2.6k
ag-grid/ag-grid

The best JavaScript Data Table for building Enterprise Applications. Supports React / Angular / Vue / Plain JavaScript.

TypeScriptnpmOtherreactangular
ag-grid.com
15.5k2.1k
myliang/x-spreadsheet

The project has been migrated to @wolf-table/table https://github.com/wolf-table/table

JavaScriptnpmMIT Licensejavascriptspreadsheet
myliang.github.io/x-spreadsheet
14.6k1.8k
PHPOffice/PhpSpreadsheet

A pure PHP library for reading and writing spreadsheet files

PHPPackagistMIT Licensephpspreadsheet
phpspreadsheet.readthedocs.io
14k3.6k
dream-num/univer

Univer is a full-stack framework for creating and editing spreadsheets / word processor / presentation on both web and server.

TypeScriptnpmApache License 2.0data-tableexcel
docs.univer.ai
13.9k1.2k
gotenberg/gotenberg

A developer-friendly API for converting many document formats into PDF files, and more!

GoGo ModulesMIT Licenseapiwkhtmltopdf
gotenberg.dev
12.7k819
OdysseusYuan/LKY_OfficeTools

一键自动化 下载、安装、激活 Office 的利器。

C#GNU General Public License v3.0kmsmicrosoft
foxmail.com
12.3k1.2k