Browser-native React viewer for .pptx and legacy .ppt, with experimental OpenDocument support for presentations and drawings (.odp, .odg), using a Rust/WASM parser, a normalized presentation model and virtualized HTML/SVG rendering.
npm install @extend-ai/react-pptxReact and React DOM are peer dependencies.
import { ReactPptxViewer } from "@extend-ai/react-pptx";
import "@extend-ai/react-pptx/styles.css";
export function Deck({ file }: { file: File }) {
return <ReactPptxViewer source={file} defaultZoom="fit-width" showThumbnails showToolbar />;
}source also accepts URLs, buffers and parsed presentations. parsePresentation, PptxViewerController and createPptxThumbnailRenderer support custom integrations. WASM loads lazily; set a custom source before parsing with setWasmSource. See the package API.
Use Node.js from .nvmrc, pnpm 9.15.0, Rust, wasm-pack and the wasm32-unknown-unknown target. Supported Node ranges are in package.json.
pnpm install --frozen-lockfile
pnpm dev
pnpm build
pnpm typecheck
pnpm test
pnpm exec playwright install chromium
pnpm test:visual --project=chromiumpnpm dev rebuilds WASM, the model and the viewer before starting the playground at localhost:4173. Restart it after changing the Rust dependency.
The playground opens PPTX files in edit mode. Click slide text or table cells to edit directly, drag an object’s border to move it, or use its eight handles to resize it. Double-click selects a word; Escape finishes text editing and keeps the object selected. Arrow keys move selected objects, and Tab cycles through them. Changes save when you leave a text box without reloading the slide. Undo/redo and Download preserve edits in the original PPTX package. The Read only switch disables editing; legacy PPT files and inherited layout/master objects remain read only. This editor is implemented in the playground; the published viewer API remains a viewer. The default presentation is a licensed excerpt with source and adaptation credits.
| Work | Start here |
|---|---|
| Public viewer, controller and hooks | packages/react-viewer |
| Presentation model | packages/presentation-model |
| Rust/WASM adapter and browser loader | packages/wasm |
| Playground and validation | apps/playground, tests, fidelity harness |
| Architecture and releases | Architecture, release guide |
Parser and shared rendering fixes belong in Duke Office; this repository owns the browser adapter and React rendering. The private native-reference corpus uses pnpm powerpoint-oracle:validate and pnpm powerpoint-oracle:compare.
- Legacy
.pptis parsed directly in the browser. Unsupported content emitsdegraded-renderingwarnings throughonWarning/showDiagnostics; see legacy format support. - OpenDocument support is experimental. Presentations and drawings are parsed directly in the browser and are view only. Rendering fidelity varies, especially for charts and custom drawing geometry; see OpenDocument support for supported file types and limitations.
- Viewing is static. Slide transitions and animation timelines are exposed on the model (
transition,timing) but not played; macros, active OLE controls, password decryption and authoring/export are outside the supported scope. Embedded audio and video play through native controls, and embedded objects are offered as downloads. - SmartArt uses saved drawings; 3D models display saved Office previews.
include3dModelsoptionally exposes original assets and scene metadata. See OfficeArt visuals.
Click the screenshot for the viewer demo and integration docs. MIT license · Third-party notices.
Extract paragraph, table-cell and word blocks with extractPresentationBlocks, resolve their source references with resolvePptxSourceGeometry, and render overlays with PptxBlockHighlights. See the citation API and source-build instructions.
