SheetXL Documentation
website·Indexed 32 days ago
https://www.sheetxl.com/docsAn Excel-compatible spreadsheet engine and modular ecosystem of TypeScript packages for React, Node.js, and vanilla JavaScript. Features include a unified range model via ICellRange, User-Defined Functions (UDFs), headless state implementation, and high-performance rendering capable of handling over 1 million rows.
What's inside SheetXL
- SheetXL provides a suite of tools to integrate spreadsheet functionality into applications. Key capabilities include a headless spreadsheet engine with 400+ Excel-like functions, a vectored columnar data store capable of handling billions of cells, and a live scripting system that allows adding custom TypeScript functions and logic on the fly without a build step.
Overview of SheetXL modular packages
SheetXL is designed as a modular ecosystem, allowing developers to include only the necessary components to minimize application footprint and maintain a clean dependency tree. The ecosystem is divided into Core, UI, and Utilities packages that are interoperable.Overview of SheetXL capabilities
SheetXL is a high-performance spreadsheet component built for developers using TypeScript and React. It is designed to provide the full flexibility of Excel within a web application, supporting 400+ functions (including INDIRECT, XLOOKUP, and spill behavior), complex formatting, and native copy-paste behavior from Excel.Introduction to SheetXL Live Scripting
Live Scripting allows developers to build custom functions and macros directly inside a spreadsheet using modern TypeScript. It features a vectorized API for range operations, real-time validation, and support for third-party libraries via unpkg and esm.sh. The SheetXL API is available ambiently via theSheetXLnamespace.Overview of SheetXL Core Spreadsheet Components
SheetXL provides a set of composable React components that can be used standalone or assembled to create a full spreadsheet experience. Core components include:
- Studio: A fully functional, embeddable application extended via Material-UI and React.
- WorkbookElement: Displays an ISheet and editing artifacts for a given Workbook.
- WorkbookToolbars: A collection of toolbars containing CommandButtons.
- FormulaBar: A wrapper around a SheetCellEditor.
- NamedInput: Editor for managing NamedReferences.
- SheetElement: Renders SheetCellRenders, SheetCellEditors, and Headers.
- SheetCellRenderer: Read-only rendering of an ICell.
- SheetCellEditor: Editor for updating an ICell.
- WorkbookStrip: Navigation tabs for switching between Sheets.
- Statusbar: A collection of StatusbarItems.
- SheetZoomScale: Editor for adjusting the zoom scale.
SheetXL performance and architecture
SheetXL is engineered for high-scale data handling, capable of processing 250MB workbooks or autofilling a million rows with formulas. It achieves this performance by utilizing design patterns from big data systems, including:
- Columnar storage
- Vectorized APIs
- Immutability
- Zero-copy architecture
- Dependency graphs
- Virtual rendering
Extend SheetXL with Custom Functions and Scripting
SheetXL allows the addition of custom functions via live scripting directly within the spreadsheet, eliminating the need for a build step. It provides a Vectored and Range-Based API for these extensions.Understand SheetXL architectural design principles
SheetXL utilizes a decoupled architecture where state is managed by headless TypeScript models and the user interface is implemented via React Components. This separation allows multiple views to operate against the same model and enables the use of models without a UI. Interaction between components and models is facilitated through hooks that wrap model callback listeners. Persistence is handled by models saving and loading JSON, while the actual I/O operations to specific locations are managed through listeners.Understand SheetXL data collection and usage
SheetXL collects minimal data to operate its service. This includes automatic website/server logs (IP address, browser type, referrer, timestamp) for security and debugging. For registered accounts, SheetXL collects the user's email address (required) and display/public name from the chosen identity provider. This data is used to manage accounts and licenses, communicate service updates, protect the service from abuse, and comply with legal obligations. SheetXL does not sell personal information, use advertising trackers, or use cookies on its public site.Understand the SheetXL Unified Range Model
SheetXL uses a Unified Range Model to balance high-performance computation with interactive spreadsheet manipulation. It provides two distinct 'flavors' of ranges:
- IRange (The Data API): Inspired by NumPy and pandas. It is a lightweight, immutable, in-memory snapshot of data used for high-speed computation. It is the primary API used when creating formula functions.
- ICellRange (The Interactive API): Inspired by Excel and Google Sheets. It is a live connection to the worksheet used to mutate formulas, formatting, and layouts. It is typically used for macros.
Understand SheetXL Themes
Cell styles utilize theIThemeinterface to determine visual effects such as colors and fonts. These themes follow OOXML standards used by Microsoft Excel and Google Sheets. Themes are typically embedded within the Sheet or Workbook and are shared when those objects are shared.SheetXL architecture and licensing
SheetXL uses a secure, serverless architecture that runs entirely in the browser or Node runtime with no backend required. The UI is provided under the MIT open source license, allowing developers to fork, embed, and own the implementation.