npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

xlsx-react-viewer

v0.1.0

Published

xlsx-viewer for React: an Excel viewer and editor component to open, edit, calculate and save .xlsx workbooks in the browser.

Readme

xlsx-react-viewer

<ExcelViewer>: a React 18/19 viewer and editor for Excel workbooks with an Office-style ribbon, formula bar, sheet tabs and status bar. Built on xlsx-viewer-core; everything runs in the browser.

import { ExcelViewer, type ExcelViewerHandle } from 'xlsx-react-viewer';
import 'xlsx-react-viewer/styles';

function Editor({ bytes }: { bytes: ArrayBuffer }) {
	const ref = useRef<ExcelViewerHandle>(null);
	return (
		<ExcelViewer
			ref={ref}
			content={bytes}
			fileName='Budget.xlsx'
			theme='light'
			onSave={async (saved, name) => upload(saved, name)}
			onDirtyChange={(dirty) => setUnsaved(dirty)}
			style={{ height: '100%' }}
		/>
	);
}

Props

| Prop | Description | | -------------------------------------- | ------------------------------------------------------------------------------------------------- | | content | Workbook bytes (.xlsx, .xlsm, .xltx, .xls). Omit for a blank workbook. | | workbook | An already parsed Workbook (takes precedence over content). | | fileName | Title bar text and download name. Saves always use an Open XML name (.xls becomes .xlsx). | | password | Password for an encrypted file; without it the viewer prompts. Saves keep the encryption. | | canEdit | false for a read-only viewer (default true). | | theme, onThemeModeChange | 'light', 'dark' or a ViewerTheme (see jadeLightTheme / jadeDarkTheme). | | onSave | Called with the serialized workbook on Save (Ctrl+S). Without it, Save downloads the file. | | onContentChange, contentChangeDelayMs | Fresh bytes after each committed change (debounced). | | onDirtyChange, onActiveSheetChange, onSelectionChange, onError | State callbacks. | | onOpenFile, onNewWorkbook | Show File > Open / New and route them to the host. | | locale | UI language: 'en' (default), 'de', 'fr', 'es' or 'zh-CN'. Switching it re-renders the UI without reloading the workbook. | | translations | Per-key UI string overrides applied on top of locale (English is the final fallback). | | authorName | Author recorded on new notes. | | showRibbon, showFormulaBar, showSheetTabs, showStatusBar, showTitleBar | Toggle chrome. |

The ref handle offers getContent(), getWorkbook(), save(), undo(), redo(), recalculate(), select(reference), setActiveSheet(index) and focus().

Languages

The UI ships in English, German, French, Spanish and Simplified Chinese, worded with Microsoft Office's own terminology for each language. Pick one with locale and override single strings with translations (keys are listed in englishTranslations):

<ExcelViewer content={bytes} locale='de' translations={{ 'app.name': 'Tabellen' }} />

BUILT_IN_LOCALES lists the codes with their native names for a language picker, and the dictionaries are exported as englishTranslations, germanTranslations, frenchTranslations, spanishTranslations and simplifiedChineseTranslations (each a complete TranslationDictionary; BUILT_IN_DICTIONARIES maps codes to them). Numbers in the chrome, such as the zoom percentage and the status-bar statistics, follow the locale; cell values keep the workbook's number formats. Messages produced by xlsx-viewer-core (for example some validation errors) are in English.

What the UI covers

  • Grid: virtualized DOM rendering with frozen panes, merged cells, text overflow, conditional formatting overlays, sparklines, tables, outlines, drawings and charts; keyboard navigation and shortcuts as in Excel (Ctrl+arrows, Shift selection, F2, F4, Ctrl+Enter, Alt+Enter, Ctrl+;, ...).
  • Ribbon: Home, Insert, Page Layout, Formulas, Data, Review and View tabs, plus the contextual Table Design tab, with galleries for cell styles, table styles and conditional formatting.
  • Dialogs: Format Cells, Insert Function, Name Manager, Data Validation, Sort, Hyperlink, Find and Replace, Go To, Page Setup, Protect Sheet / Workbook, conditional formatting rules, Text to Columns, Remove Duplicates and more.
  • File menu: save, export (CSV, Markdown, JSON, HTML), print with preview, document properties and password encryption.

Styling

The stylesheet is self-contained (Tailwind utilities without a global reset, scoped to the viewer). Colors come from CSS variables derived from the theme, so a custom ViewerTheme restyles the chrome, the grid headers and the selection.

License

MIT