Profile
Back to NewsBack
GitHub Trending 31 min
Reader Mode
yukiyokotani/office-open-xml-viewer: A browser-based viewer for Office Open XML documents that renders to an HTML Canvas element.

yukiyokotani/office-open-xml-viewer: A browser-based viewer for Office Open XML documents that renders to an HTML Canvas element.

11 hours ago
[!NOTE]
This entire codebase — Rust parsers, TypeScript renderers, tests, and tooling — is implemented by AI coding agents, primarily Claude and Codex, through iterative prompting. No human-written application code exists in this repository.

Why this project exists — a note from the author


OOXML's behavior is defined by a written specification (ECMA-376 / ISO-29500), and there is a clear answer to compare against: Word, Excel, and PowerPoint themselves. In principle, anyone with enough patience could have built a faithful viewer — the spec says what to implement, and the Office applications show whether you got it right.

In practice, it didn't happen. For more than a decade, no free, open-source library reached a rendering quality good enough for real use. There are a few commercial libraries with decent fidelity (and editing support), but their pricing makes them hard to adopt casually. I think the reason is simply cost: the specification is huge, and reading and implementing it faithfully takes far more effort than volunteers can afford.

Generative AI changed that. A viewer is an unusually good fit for AI-driven iterative development ("vibe coding"): there is a spec to read and a correct output to aim for, so the work comes down to interpreting the specification and refining the rendering until it matches. Limiting the scope to viewing also avoids the most serious risk an Office library can carry — corrupting a user's files.

So I'm building this library with AI coding agents, spec-first, and keeping it free to use. For some documents it already reproduces the desktop Office applications more faithfully than commercial libraries — and sometimes even the official Microsoft 365 web apps.

office-open-xml-viewer

Office Open XML Viewer

npm version</a> npm downloads</a> VS Code Marketplace</a> license</a>

Live demo

A browser-based viewer for Office Open XML documents that renders to an HTML Canvas element. The parsers are written in Rust and compiled to WebAssembly; the renderers use the Canvas 2D API. Each format also exposes a headless engine (DocxDocument / XlsxWorkbook / PptxPresentation) that renders into any caller-supplied canvas, so you can compose your own UI — scroll views, thumbnail grids, master-detail panes — instead of being locked into the built-in viewer. See the live framework examples for runnable React, Vue, Svelte, and Solid projects.

Project scope: read-only viewing

This project is intentionally a read-only viewer. Editing interfaces, mutation APIs, editable or lossless document models, saving / round-tripping, and partial editing of DOCX, XLSX, or PPTX files are out of scope. Read-only interactions such as selection, copy, search, shape IDs, hit testing, and annotation or external-tool integrations remain in scope, and editing-focused forks are welcome. See #496 for the rationale.

| DOCX | XLSX | PPTX | |:---:|:---:|:---:| | !docx | !xlsx | !pptx |

npm install @silurus/ooxml

or

pnpm add @silurus/ooxml
Bundler note: the Rust parsers ship as real .wasm asset files next to the
JavaScript, referenced with the standard new URL('…', import.meta.url) form
and fetched (streaming-compiled) at load time. Verified to work with zero
config: webpack 5, Next.js (Turbopack, dev and build), Vite 8
(dev and build), Vite 7 production builds, and a plain
Chat with me