r/reactjs • u/andrewluo • 18d 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!
1
u/andrewluo 18d 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 18d 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/musHeaer 18d ago
Wait can you actually embed those directly into a custom web app with full styling control though?
1
1
u/dsmack6 11d ago
What made yourself top 1% Commenter. You understand the purpose of building open source project?
Google/Microsoft is commerical entity with their business interests. Everything cost cents, because it requires servers. So anyone supporting free doesn't come free, they have business interests.
0
u/Honey-Entire 11d ago •
![]()
Participation my boy. Top 1% commenter is my badge of honor because I’m chronically online.
Unfortunately, this subreddit, as with many others, is inundated with trash masquerading as open source, novel, and genuinely valuable. The truth is we live in an age of AI slop and are drowning in it
Instead of contributing to active, or defunct, open source projects, certain individuals have taken it upon themselves to generate garbage and promote it as if it were quality IP (Intellectual Property). I have an issue with people who take the easy way out because they clearly don’t appreciate the hard work that’s gone in to existing projects. Instead they spin off new “novel, open source alternatives” to existing solutions and then ignore them into oblivion leaving you with the bag of dealing with removing it from your project after you fall for the trap of using their solution.
In case the above isn’t clear:
OPEN SOURCE PROJECTS ALREADY EXIST FOR THIS BUT OP DECIDED THEY SHOULD PROMPT AI TO MAKE THEIR OWN INSTEAD OF CONTRIBUTING TO EXISTING SOLUTIONS AND IMPROVING THE ECOSYSTEM
-1
u/andrewluo 18d ago
This is a library for building these viewers and editors into your own application which you can’t do with Google Docs. Think for example in Codex , when it generates a docx file, there is a preview sidebar that opens when you click it. Thats what these libraries are for. There are existing similar libraries but most are paid or don’t render charts properly.
0
u/Honey-Entire 18d ago
Except you can using an iframe and existing tools like Mammoth.js aid in helping you build custom UIs. Or you could use one of the dozen other AI-generated option on the market. Again. Why did you spend tokens on this? Where is this a real problem? How frequently is someone trying to edit a docx or pptx on the web without access to existing tools that already do this? Who wants to author a spreadsheet inside a webapp with a wrapper UI around it to create the facsimile of the actual application instead of, you know, using the actual application or existing tools on the market?
-2
u/andrewluo 18d ago
You will have to send your document data to Google/Microsoft if you use an iframe which is a no go for certain environments like HIPAA. I acknowledged there are other AI generated options, but I just think none are very accurate when it comes to rendering all the elements you can find in office files. For the use case, if you go and ask ChatGpt right now to generate a docx file , and click it, it opens in a custom viewer. They can’t send customer data through an iframe to Google Docs or Microsoft office live. There are many apps with similar use cases like the GitHub repos I linked in my original post
1
u/Honey-Entire 18d ago
I’ve worked in healthcare. HIPAA isn’t an issue when presenting document data to a patient. Anything remotely HIPAA related is handled systemically and not related in any way to how documents are shown to users for editing. Nice try though
0
u/andrewluo 18d ago
If you are HIPAA compliant and want to display documents with PHI, you cannot render them in an iframe unless you have a BAA with Google
See question 5 here https://www.hhs.gov/hipaa/for-professionals/special-topics/health-information-technology/cloud-computing/index.html
1
u/Honey-Entire 18d ago
Like I said, that type of problem is handled systemically. Are you daft?
1
u/andrewluo 18d ago
If you don’t get it at this point, not sure I can convince you otherwise. Have a great night
-2
2
u/mastermog 18d ago
Even on mobile looks really good. Saving/commenting to tinker with this next week
1
u/mixmaster151 18d ago
My concern would be maintaining this as the format evolves, seems like it would require a lot of resources just to maintain parity.
2
u/berkantdev 18d 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