Show any document in your React app.
Word, Excel, PowerPoint, PDF and dozens more file types, drawn in the browser. Files never leave the reader's device, and there is no server to run.
npm i @openpreview/reactWhat it opens
Detected from the file's bytes, not its name, so a mislabelled upload still opens with the right renderer.
- WordDOCX, DOCM, DOTX
- Paged layout, styles, tables, headers and footers, footnotes, comments, charts
- ExcelXLSX, XLSM, XLTX
- Sheet tabs, formulas shown, merges, frozen panes, charts, conditional formatting
- PowerPointPPTX, PPSX, POTX
- Masters and layouts, 187 preset shapes, tables, charts, notes, presenter mode
- PDFPDF
- pdf.js in a worker, text selection, passwords, 1,000-page files stay smooth
- OpenDocumentODT, ODS, ODP
- LibreOffice files through the same Word, Excel and PowerPoint renderers
- Spreadsheets and dataCSV, TSV, JSON, XML
- Delimiter detection, a million rows windowed, collapsible JSON tree
- Text and codeMarkdown, 200+ languages, notebooks
- Shiki highlighting, sanitised Markdown, Jupyter outputs, huge logs
- ImagesPNG, JPEG, TIFF, HEIC, SVG, EMF and more
- Own TIFF and metafile decoders, multi-page scans, scripts in SVG never run
- Email and archivesEML, MSG, ZIP
- Messages with attachments, archives with a file tree; each opens in a nested viewer
- Web and mediaHTML, audio, video
- Pages in a locked-down sandbox; native players for media
One component to start
Pass a File, a Blob, bytes or a URL. Toolbar, search, thumbnails, printing and keyboard support come with it. Build your own UI with the hooks when you need to.
Read about the headless hooksimport { DocViewer } from '@openpreview/react';import '@openpreview/react/styles.css';export function Preview({ file }: { file: File }) { return <DocViewer source={file} />;}Why in the browser
Private by default
Contracts, payslips and medical records are read on the device. Nothing is sent to a conversion service.
No server to pay for
No LibreOffice farm, no per-page API pricing. Static hosting is enough.
Fast on big files
Parsing runs in workers, and long PDFs, sheets and logs draw only what is on screen.
Accessible and translatable
Keyboard and screen-reader support, WCAG AA colours, every label translatable, right-to-left ready.