r/reactjs • u/andrewluo • 11d ago
Show /r/reactjs I built React (+ vanilla JS) viewers/editors for Excel, Word, Powerpoint (5m+ total npm downloads)
I know there have been a few similar projects before in here, but I wanted to share our take on what great Office/OpenDocument viewers & editors looks like for the web.
We've built 3 packages (repos and playgrounds attached), all MIT:
react-docx — Word viewer/editor with pagination, charts, SmartArt, WordArt, equations, tracked changes, and DOCX export.
react-xlsx — Excel viewer/editor with formulas, charts, editable pivot tables, drawing support, and XLSX/CSV export.
react-pptx — PowerPoint viewer with charts, SmartArt, shapes, equations, embedded audio/video, and slide thumbnails.
We launched these a few months ago and they're now used in some pretty big projects on GitHub like RAGFlow (94k), Kortix CompanyOS (20.7k), ZCode (8.7k) . Combined they now have 5m+ total npm downloads.
Each repo has some visual examples comparing visual parity for various charts and art
They are built in a way where you can fully customize and get the look of your design system in the toolbar, dropdowns, and context menus.
File types supported:
| Library | Office formats | OpenDocument formats |
|---|---|---|
| react-docx | .docx, .dotx, .docm, .dotm, .doc, .dot | .odt, .ott, .odm, .otm, .oth, .fodt |
| react-xlsx | .xlsx; limited support for .xls, .xlsm | None (pending) |
| react-pptx | .pptx, .ppt | .odp, .otp, .fodp, .odg, .otg, .fodg |
Personally I think they are the some fastest and most accurate OSS rendering libraries for these files out there, and would be great to see even more adoption, feature requests and people testing them against weird documents
Feedback and general bug reports are always appreciated. Hope this is helpful!
2
u/berkantdev 11d ago
the parity examples are a nice touch. curious how react-xlsx handles really big sheets, is it virtualized DOM cells or do you draw the grid to a canvas? i've been playing with large numbers of live DOM nodes lately and the scroll/zoom cost is always the hard part
1
u/andrewluo 11d ago
Hi everyone! Wanted to share in case this is useful. I’ve personally never understood why companies were charging thousands of dollars for these document SDKs . These projects have been a work in progress since July. Editing can still be finicky!
1
u/Honey-Entire 11d ago
Ok but why? Microsoft has had online tools for this for a decade now and Google Docs has supported Microsoft’s document formats in their apps for even longer. Tools like what you’re presenting already exist, but you spent tokens to create another option because…?
2
u/mastermog 11d ago
Even on mobile looks really good. Saving/commenting to tinker with this next week
1
u/mixmaster151 11d ago
My concern would be maintaining this as the format evolves, seems like it would require a lot of resources just to maintain parity.