EU AI Act deadlines are already in effect: Get the Checklist

Apryse How-To Guide

How to Add Spreadsheet Editing to a React Application

Integrate the Apryse Web SDK (WebViewer) with the Spreadsheet Editor add-on to load XLSX, XLS, and CSV files and run the entire edit session in the browser through WebAssembly, with no server round trip for document processing.

React Spreadsheet Editor Overview

To add spreadsheet editing to a React application, integrate the Apryse Web SDK (WebViewer) with the Spreadsheet Editor add-on. The SDK loads XLSX, XLS, and CSV files and runs the entire edit session in the browser through WebAssembly, with no server round trip for document processing. The document viewer SDK uses an event to check if the Spreadsheet Editor is ready before loading spreadsheet files.

Get a trial license key and follow along: Start a Free Trial

React Spreadsheet Editor vs React Data Grid

Copied to clipboard

A Spreadsheet Editor and a data grid solve different problems. A React data grid displays and manipulates tabular data, typically with sorting, filtering, and column configuration built on top of an array of rows. Essentially, data grids are intended to display your data in a familiar, spreadsheet-like interface. In comparison, the Spreadsheet Editor opens and edits the spreadsheet file itself, including formulas, charts, and cell formatting, without converting the file.

Use a data grid when the application already has structured data in memory and needs fast tabular interaction. Use the Spreadsheet Editor when users need to open, edit, and hand back an actual XLSX, XLS, or CSV file, including one built by someone else in Excel.

Building a DOCX Editor into the same application follows the same integration pattern described below, since both add-ons share the WebViewer constructor and event-gate model. If the application is built on Angular instead of React, the Angular spreadsheet integration guide covers the equivalent setup.

Developers evaluating this capability in React typically compare it against AG Grid or Handsontable, both data grid libraries, against SheetJS, a file-parsing library with no visual editor, or against Syncfusion's React Spreadsheet component, the closest like-for-like alternative with its own grid-based editing UI.

Feature
Syncfusion Spreadsheet
Handsontable
AG Grid
Apryse Spreadsheet Editor
File I/O (open an actual XLSX, XLS, or CSV)
Imports and exports XLSX, XLS, and CSV natively.
Requires additional libraries for spreadsheet files.
built-in export of values only, requires additional libraries for import
Opens XLSX, XLS, and CSV directly. Saves and downloads as XLSX or PDF.
Formula engine
Built-in Excel-compatible formula engine as part of the Spreadsheet component.
Requires additional plugins.
No live formula engine. Value getters can be converted to static Excel formula text on export only.
Evaluates standard mathematical, statistical, date/time, financial, and lookup functions consistent with Excel.
Charts
Charting is a separate Syncfusion component, not part of the Spreadsheet control's workbook rendering.
Not supported.
Requires additional modules.
Renders charts already embedded in the workbook. Users select, move, and resize them. Creating new charts is not yet supported.
Cell formatting
Fonts, fill, alignment, and conditional formatting are part of the spreadsheet UI.
Styling is read from the rendered DOM at export time, plus grid-level cell renderers.
Cell styling is primarily an export-time configuration, not native workbook formatting.
Font, size, color, borders, fill, bold, italic, underline, and strikethrough.
Export
XLSX, XLS, CSV, and PDF.
CSV built in. XLSX export typically needs a plugin.
Saves and exports to XLSX and CSV.
XLSX and PDF. Does not save back to XLS or CSV.
Server dependency
None for the core spreadsheet component.
None.
None for the core grid. A server-side row model is optional for large datasets.
None. Processing runs client-side through WebAssembly.
Ecosystem
Syncfusion offers a Spreadsheet component as one of many “Essential Studio” controls, with PDF, Word, and Excel each shipping as separate viewer or editor products rather than one integrated document platform.
Handsontable offers a single-purpose data grid, with no document viewing, conversion, extraction, or signing products in its lineup.
AG Grid offers a single-purpose data grid, with charts as a separate Enterprise module and no document viewing, conversion, extraction, or signing products.
Apryse offers the Spreadsheet Editor as one add-on in the Web SDK, alongside the DOCX Editor, PDF Editing, and other add-ons. The Apryse Developer Toolkit extends the same file to the Server SDK, Mobile SDK, and Scanbot SDK, covering viewing, editing, conversion, extraction, and signing under one vendor.

Implementation Details

Installing the Apryse WebViewer SDK in React

Copied to clipboard

To install via npm, use:

WebViewer also requires copying static assets from node_modules/@pdftron/webviewer/public into a publicly served directory before the SDK will initialize. See the static assets guide for full instructions, including automation options for webpack and Parcel.

In the component, a useRef holds the DOM element the SDK mounts into, and a useEffect calls the WebViewer constructor once that element exists. The constructor requires a path to the copied assets and a license Key. Both must be present, since a constructor missing either fails immediately.

For the full setup, see the React get started docs.

Listening for the SPREADSHEET_EDITOR_READY Event

Copied to clipboard

SPREADSHEET_EDITOR_READY is the event gate for the Spreadsheet Editor. The SpreadsheetEditorManager and the Workbook object are only accessible after this event fires. Calling setEditMode, reading a cell, or touching a chart before that point does not throw an error. It fails silently, which makes the missing event listener a common first bug for developers new to the add-on.

Register the listener on documentViewer immediately after the WebViewer constructor resolves, before calling loadDocument. That ordering guarantees the listener is in place before the event has a chance to fire.

Loading Spreadsheet Files in React

Copied to clipboard

While data grid components can't load XLSX files without additional installs, Apryse WebViewer can view and edit PDF, DOCX and XLSX files, as well as CAD and images. Spreadsheet Editor activates automatically once an XLSX, XLS, or CSV file is loaded into a WebViewer instance with the add-on license.

  • Remote URL: pass the URL to documentViewer.loadDocument(url). Supports HTTP and HTTPS, including S3 buckets.
  • Local file: pass a File or Blob from a file input or drag-and-drop handler directly to loadDocument().
  • In-memory document: pass a base64 string or ArrayBuffer to loadDocument().

XLS and CSV files convert to XLSX in the browser on load. The source file in storage is not modified.

Enabling Edit Mode

Copied to clipboard

The Spreadsheet Editor opens in View mode by default, which allows grid navigation and viewing calculated cells and formulas but no editing. Switch to Edit mode explicitly:

setEditMode takes the SpreadsheetEditorEditMode enum rather than a boolean. In Edit mode, users can format cells (font, size, color, borders, bold, italic, underline, strikethrough), add, edit, and delete rows and columns, cut, copy and paste, and merge cells.

Formula Support

Copied to clipboard

Formula support covers common formulas across math and trigonometry, statistics, date and time, text, logical, lookup and reference, financial, and engineering categories. Find the full list in our documentation.

Chart Support

Copied to clipboard

The Spreadsheet Editor renders Column, Bar, Pie, Donut, Line, Area, Scatter, Stock, Radar, Histogram, and Sunburst charts. Three-dimensional chart types render as their two-dimensional equivalent.

Users can select, move, and resize charts already present in a workbook, and the API exposes those same interactions for building custom controls into the application. Chart creation, chart styling, and chart type changes are not currently supported.

Exporting and Saving from React

Copied to clipboard

The Spreadsheet Editor saves and downloads the edited workbook as XLSX or PDF. It does not save or export back to XLS or CSV.

Client-Side Processing and Data Residency

Copied to clipboard

Spreadsheet Editor, including opening a file, evaluating a formula, rendering a chart, saving an edit, runs inside the browser through Apryse's WebAssembly-compiled core. No document content is transmitted to Apryse infrastructure at any point. For teams evaluating client-side spreadsheet processing for data residency requirements, this means spreadsheet data never leaves the boundary the browser already operates inside, without a server component in the request path.

Frequently Asked Questions

Yes. WebViewer mounts on any DOM element a JavaScript framework can provide, and that includes Next.js alongside React, Angular, Vue, Svelte, Nuxt, Vite, Electron, and Blazor.See the Next.js setup guide for the framework-specific setup.

Apryse does not publish a fixed minimum React version for WebViewer, since the constructor only requires a DOM element to mount into. Check the React integration guide for the current framework guidance before starting an integration.

Yes. Once SPREADSHEET_EDITOR_READY has fired, the Workbook and SpreadsheetEditorManager objects support programmatic data manipulation, including adding, editing, and deleting rows and columns.. See the Spreadsheet Editor edit mode guide for the current API reference.

No. Real-time co-editing is not currently supported in the Spreadsheet Editor. Multiple users cannot edit the same workbook session simultaneously with changes reflected live to each other.

Initialize WebViewer and register the event listener in componentDidMount, after the constructor promise resolves. Remove the listener in componentWillUnmount to avoid duplicate handlers if the component re-mounts.

Try It in Your Own React Application

Try It in Your Own React Application