syncfusion-react-spreadsheet-editor
Syncfusion React Spreadsheet Editor
Overview
This skill helps developers generate React (JSX/TSX) code for integrating the Syncfusion Spreadsheet Editor into their applications. It provides ready-to-use code snippets, API guidance, and best practices for building Excel-like functionality in React projects.
Key Capabilities
- File Operations: Import/export Excel files (
xlsx,xls,xlsb), CSV files, and PDF export - Data Management: Data binding, editing, sorting, filtering, and validation
- Cell Operations: Formatting (fonts, colors, borders, alignment), merge cells, wrap text
- Formulas & Calculations: Built-in Excel formulas, custom functions, named ranges
- Collaboration: Notes, comments, and threaded discussions
- Advanced Features: Charts, images, hyperlinks, conditional formatting, freeze panes, sheet protection, virtualization for large datasets
Quick Start Examples
Example 1: Generate Spreadsheet with Formatting
User: "Create a Spreadsheet with data and apply cell styles"
Result: A React (JSX) code snippet is generated that loads provide data into the Spreadsheet and applies basic cell formatting.
Example 2: Generate Code for Loading a File
User: "Create a Spreadsheet and load an Excel file initially"
Result: A React (JSX) code snippet is generated that initializes the Spreadsheet and programmatically opens an Excel file on startup.
Getting Started — Minimal React Code
Minimal React Spreadsheet setup for a plain web project:
import * as React from 'react';
import { SheetsDirective, SheetDirective } from '@syncfusion/ej2-react-spreadsheet';
import { RowsDirective, RowDirective, CellsDirective, CellDirective } from '@syncfusion/ej2-react-spreadsheet';
import { SpreadsheetComponent } from '@syncfusion/ej2-react-spreadsheet';
function Default() {
const spreadsheetRef = React.useRef(null);
return (<div className='control-pane'>
<div className='control-section spreadsheet-control'>
<SpreadsheetComponent ref={spreadsheetRef}>
<SheetsDirective>
<SheetDirective>
<RowsDirective>
<RowDirective>
<CellsDirective>
<CellDirective value="Hello, Spreadsheet!" ></CellDirective>
</CellsDirective>
</RowDirective>
</RowsDirective>
</SheetDirective>
</SheetsDirective>
</SpreadsheetComponent>
</div>
</div>);
}
export default Default;
Generate React (JSX) Code for the User's Project
Trigger keywords: "react spreadsheet", "spreadsheet editor", "syncfusion spreadsheet", "excel component", "load excel file", "open excel file", "import excel", "export excel file", "save excel", "export to pdf", "export to csv", "view excel", "configure spreadsheet", "create spreadsheet", "add spreadsheet", "spreadsheet data", "cell formatting", "apply formulas", "insert chart", "data binding", "spreadsheet validation", "freeze panes", "protect sheet"
Workflow:
-
Identify the requested Spreadsheet feature (data binding, formulas, charts, export, etc.).
-
Read the relevant
references/*.mdfile(s) to understand the APIs and code patterns for the requested feature. -
STOP before generating code. Check if the user has already chosen a delivery mode.
-
If no delivery mode is chosen yet, you MUST ask the user first using this concise multiple-choice question:
"How would you like to receive the generated Spreadsheet code?"
- Option 1: Replace the code in a specific project file (you'll need to provide the file path and confirm)
- Option 2: Save the code in this skill's output folder at
{skill-root}/syncfusion-react-spreadsheet-editor/output/app.jsx(or.tsx) - Option 3: Share the code directly in the chat window
-
Only after the user selects a delivery mode, proceed to generate React(JSX/TSX) code using the APIs and snippets from
references/*.md, substituting concrete placeholders from the user's project. -
Do NOT make changes to workspace project files unless the user explicitly chose Option 1 and provided the file path with permission.
-
Provide complete React snippets and concise integration steps after delivering the code.
Refer to ## Rules section for operational constraints (output directory, temporary files, allowed libraries, etc.)
Code References
All code snippets and examples are in the references/ folder. Each file contains:
- Minimal React(JSX) Code — a working, ready-to-use snippet
- Placeholders — values the user must customize
- Notes — React best practices and constraints
| File | Topic |
|---|---|
| initialization.md | Basic React setup and options |
| data-binding.md | Local arrays, JSON, remote (DataManager) |
| formulas.md | Formulas, aggregates, named ranges |
| formatting.md | Cell formatting, borders, wrap text |
| number-formatting.md | Number formatting, decimals, currency, date |
| conditional-formatting.md | Rules, highlights based on conditions |
| data-validation.md | Validation rules, invalid highlights |
| sorting-filtering.md | Sorting, filtering |
| find-replace.md | Find, replace |
| import-export.md | Save (XLSX/CSV/PDF), open, openFromJson |
| charts.md | Insert, edit, delete charts |
| images.md | Insert, modify pictures |
| hyperlink.md | Add, remove hyperlinks |
| comments.md | Threaded comments, replies, resolve threads |
| notes.md | Simple cell notes, sticky visibility, add/edit/delete |
| protection.md | Sheet protection, cell locking, permissions |
| edit-cell.md | startEdit, endEdit, updateCell, edit modes |
| freeze-panes.md | Freeze rows/columns, split panes |
| row-column.md | Insert, delete, resize rows/columns, hide |
| merge-cells.md | Merge, unmerge cells, spanning |
| print.md | Page setup, headers/footers, scaling, margins |
| misc-operations.md | Autofill, clear, sheet management, goTo |
| clipboard.md | Copy, cut, paste with different paste types |
| selection.md | Select cells/ranges, multi-select, getSelectedRange |
| scrolling-virtualization.md | Virtual scrolling, large datasets, performance |
| wrap.md | Text wrapping, multi-line display, row height |
| defined-names.md | Named ranges, define names, refersTo format |
| custom-functions.md | Custom calculation functions, addCustomFunction |
| ribbon-customization.md | Ribbon tabs, toolbar items, file menu customization |
| context-menu.md | Right-click context menu, contextMenuBeforeOpen |
| localization.md | Multi-language, locale, RTL, number/date formats |
| events.md | Event handling, event properties, event patterns |
| autofill.md | Autofill patterns, fill types, series |
Key Rules for Code Generation (React (JSX)-first)
-
React (JSX)-first snippets — All examples and snippets must be written in React JSX and compile with the current
@syncfusion/ej2-react-spreadsheetnpm package. If the user asks for providing React TSX, provide React TSX codes. -
No inline code in this manifest — Refer to
references/*.mdfor runnable snippets; keep this file as the concise policy and index. -
Reference file requirements — Each reference must include:
- Minimal React (JSX) Code (complete, runnable)
- Placeholders (clearly marked values to replace)
- Notes (React integration steps and best practices)
-
License handling — Do not hardcode license keys; refer users to env variables or project config.
-
Preserve data integrity — Preserve existing formulas, references, and formatting when generating or editing sheets.
-
No hallucinated APIs — Use verified Syncfusion Spreadsheet Editor Component method names only.
-
Read references first — For any requested feature, always read the relevant
references/*.mdfile(s) first before generating code. -
Build strictly from references — Build React code strictly from the APIs, methods, properties, events, and snippets found in the reference files. Do NOT invent, guess, or suggest any API, method, property, or event not explicitly present in the reference files.
Rules
- Output files must go in
{skill-root}/syncfusion-react-spreadsheet-editor/output/directory when user selects Option 2 - Only use Syncfusion Spreadsheet APIs — never recommend or use alternative spreadsheet libraries (e.g., react-spreadsheet, handsontable, ag-grid)
- No temporary files — never create temporary scripts, intermediate files, or scaffolding outside the output directory
- React-only code — all generated code must be valid React (JSX/TSX), never generate vanilla JavaScript, jQuery, or non-React patterns