r/reactjs • • 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:

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:

LibraryOffice formatsOpenDocument formats
react-docx.docx, .dotx, .docm, .dotm, .doc, .dot.odt, .ott, .odm, .otm, .oth, .fodt
react-xlsx.xlsx; limited support for .xls, .xlsmNone (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!

0 Upvotes

19 comments sorted by

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

There’s both dom and canvas mode (canvas is default)

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/musHeaer 11d ago

Wait can you actually embed those directly into a custom web app with full styling control though?

1

u/andrewluo 10d ago

No, you cant

1

u/dsmack6 4d 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 4d ago • Bravo

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 11d 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 11d 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 11d 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 11d 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 11d 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 11d ago

Like I said, that type of problem is handled systemically. Are you daft?

1

u/andrewluo 11d ago

If you don’t get it at this point, not sure I can convince you otherwise. Have a great night

2

u/dsmack6 4d ago

He is dumb, he don't understand what open source project means. Let him give one task to work on profitable business with direct control, with profit sharing

-2

u/rydencode 11d ago

AI slop clowns lost all critical thinking abilities

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.