Enterprise Component — The SpreadsheetViewer component is available to Reducto enterprise customers.
Contact sales@reducto.ai to get access.
Overview
TheSpreadsheetViewer component provides a powerful, read-only Excel spreadsheet viewer with support for bounding box overlays. It’s designed to visualize Reducto extraction results directly on your spreadsheet documents.
Excel Support
View
.xlsx and .xls files with full sheet navigationBounding Boxes
Overlay extraction results with clickable, colored regions
Zero Tailwind
CSS Variables for easy theming without Tailwind dependency
TypeScript
Full type definitions included for excellent DX
Installation
1
Configure npm registry
Create or update your project’s
.npmrc file to authenticate with GitHub Packages:.npmrc
2
Set your authentication token
Reducto will provide you with an access token. Set it as an environment variable:
- macOS / Linux
- Windows
- CI/CD
Add to your shell profile (Then reload your shell:
~/.bashrc, ~/.zshrc, etc.):3
Install the package
- npm
- yarn
- pnpm
4
Import the styles
Import the CSS file in your application’s entry point:
App.tsx or main.tsx
Quick Start
Here’s a minimal example to get you started:The
SpreadsheetViewer requires a container with defined dimensions. Always wrap it in a parent element with explicit height and width.Usage Examples
Basic Viewer
Display a spreadsheet without any overlays:With Bounding Boxes
Highlight specific regions of the spreadsheet with colored bounding boxes:Integrating with Reducto API Results
Convert Reducto extraction results to bounding boxes:Custom Styling with CSS Variables
Override the default styles using CSS variables:custom-theme.css
All available CSS variables
All available CSS variables
API Reference
SpreadsheetViewer Props
string
required
URL to the Excel file (
.xlsx or .xls). Can be a relative path, absolute URL, or blob URL.BoundingBox[]
Array of bounding boxes to overlay on the spreadsheet.
(metadata: WorkbookMetadata) => void
Callback fired when the workbook is successfully loaded.
(error: SpreadsheetError) => void
Callback fired when an error occurs loading or parsing the file.
(bbox: BoundingBox) => void
Callback fired when a bounding box is clicked.
string
Additional CSS class name for the container element.
React.CSSProperties
Inline styles for the container element.
BoundingBox Type
WorkbookMetadata Type
SpreadsheetError Type
Troubleshooting
Package not found during installation
Package not found during installation
Ensure your If using a monorepo, place the
.npmrc is configured correctly and the REDUCTO_NPM_TOKEN environment variable is set:.npmrc in the root directory.CORS errors when loading spreadsheets
CORS errors when loading spreadsheets
If loading files from a different domain, ensure the server sends appropriate CORS headers:Alternatively, proxy the request through your own backend or use blob URLs.
Bounding boxes not appearing
Bounding boxes not appearing
Verify that:
- The
pageproperty matches the sheet number (1-indexed) - The
topandleftvalues are within the sheet bounds - You’ve imported the CSS file
Styles not applying
Styles not applying
Make sure you import the CSS file in your app’s entry point:If using CSS modules or scoped styles, ensure the import is global.
Support
Get Access
Contact sales@reducto.ai to get access to
@reductoai-collab/components and receive your authentication token.