Use a document viewer component for react like react-doc-viewer:- https://www.npmjs.com/package/react-doc-viewer

codesandbox:- https://codesandbox.io/s/zvk4j

Answer from Alan Shajan Mattathil on Stack Overflow
🌐
StackBlitz
stackblitz.com › edit › react-docs-viewer
React Docs Viewer - StackBlitz
Starter project for React apps that exports to the create-react-app CLI.
Pricing
StackBlitz is the collaborative browser-based IDE for web developers. StackBlitz eliminates time-consuming local configuration and lets developers spend more time building.
Careers
We're hiring! Build what's next in AI websites, apps, and product creation. Explore career opportunities at Bolt today.
🌐
StackBlitz
stackblitz.com › edit › react-react-doc-viewer-mce918
React React Doc Viewer (forked) - StackBlitz
A create-react-app project based on react, react-dom, custom-error, @babel/runtime, logging-library, react-doc-viewer and react-file-viewer.
Discussions

reactjs - All kinds of document viewer in react - Stack Overflow
I want to make document viewer in react which shows document in same page as popup as that is used in slack web application? It should view all kind of document files. Can anyone guide me how to p... More on stackoverflow.com
🌐 stackoverflow.com
Newest 'react-doc-viewer' Questions - Stack Overflow
Stack Overflow | The World’s Largest Online Community for Developers More on stackoverflow.com
🌐 stackoverflow.com
reactjs - react-doc-viewer won't show Docx file, shows blank - Stack Overflow
I am trying to use DocViewer in reactjs to display docx file which is hosted over the internet, it gives me some blank page , checking over the internet i have since not been able to see and unders... More on stackoverflow.com
🌐 stackoverflow.com
Want to create a custom document viewer.
I have used cyntler/react-doc-viewer to open pre-signed s3 documents and it works fine. The only issue it causes when it tries to fetch signed urls since tokens are long and can also have "?" which react-doc-viewer will treat it as a query parameter it fails to open the file. You might have to use url shortner service at backend. More on reddit.com
🌐 r/react
11
4
September 3, 2024
🌐
npm
npmjs.com › package › react-doc-viewer
react-doc-viewer - npm
3 weeks ago - import DocViewer from "react-doc-viewer"; function App() { const docs = [ { uri: "https://url-to-my-pdf.pdf" }, { uri: require("./example-files/pdf.pdf") }, // Local File ]; return <DocViewer documents={docs} />; }
      » npm install react-doc-viewer
    
Published   Mar 16, 2026
Version   0.1.16
Author   Matthew Mogford
Find elsewhere
🌐
Stack Overflow
stackoverflow.com › questions › tagged › react-doc-viewer
Newest 'react-doc-viewer' Questions - Stack Overflow
I am using react-doc-viewer to view different file types, all other file types works fine, but the issue occurs when trying with pdf files, the react-doc-viewer itself is hitting the uri provided by ...
🌐
GitHub
github.com › cyntler › react-doc-viewer
GitHub - cyntler/react-doc-viewer: File viewer for React. · GitHub
File viewer for React v17+. This is a fork of https://github.com/Alcumus/react-doc-viewer (inactivity for a long time).
Starred by 462 users
Forked by 148 users
Languages   TypeScript
🌐
GitHub
github.com › Alcumus › react-doc-viewer
GitHub - Alcumus/react-doc-viewer
import DocViewer from "react-doc-viewer"; function App() { const docs = [ { uri: "https://url-to-my-pdf.pdf" }, { uri: require("./example-files/pdf.pdf") }, // Local File ]; return <DocViewer documents={docs} />; }
Starred by 330 users
Forked by 115 users
Languages   TypeScript 75.6% | JavaScript 24.4% | TypeScript 75.6% | JavaScript 24.4%
🌐
StackBlitz
stackblitz.com › edit › try-react-file-viewer
Try React File Viewer - StackBlitz
Starter project for React apps that exports to the create-react-app CLI.
🌐
CodeSandbox
codesandbox.io › examples › package › react-doc-viewer
react-doc-viewer examples - CodeSandbox
Use this online react-doc-viewer playground to view and fork react-doc-viewer example apps and templates on CodeSandbox.
🌐
npm
npmjs.com › package › @cyntler › react-doc-viewer
@cyntler/react-doc-viewer - npm
September 24, 2025 - File viewer for React v17+. This is a fork of https://github.com/Alcumus/react-doc-viewer (inactivity for a long time).
      » npm install @cyntler/react-doc-viewer
    
Published   Sep 24, 2025
Version   1.17.1
Author   Matthew Mogford / Damian Cyntler
🌐
CodeSandbox
codesandbox.io › s › zvk4j
react-doc-viewer-demo - CodeSandbox
May 10, 2021 - react-doc-viewer-demo by Abed42 using react, react-doc-viewer, react-dom, react-scripts
Published   May 07, 2021
Author   Abed42
🌐
StackBlitz
stackblitz.com › edit › react-eghxzn
React (forked) - StackBlitz
A React project based on react, react-dom and react-doc-viewer
🌐
GitHub
github.com › cyntler › react-doc-viewer › releases
Releases · cyntler/react-doc-viewer
September 24, 2025 - File viewer for React. Contribute to cyntler/react-doc-viewer development by creating an account on GitHub.
Author   cyntler
🌐
Reddit
reddit.com › r/react › want to create a custom document viewer.
r/react on Reddit: Want to create a custom document viewer.
September 3, 2024 -

I am asked to create a custom document viewer . ( doc types include - csv's , pdf's , xlsx , ppt's etc. etc.. all the common document types )
I used these 2 libraries :

react-doc-viewer
cyntler/react-doc-viewer

Both support multiple file types , but the '.doc' and '.docx' types are supported only with public URL's
( a few more file types are also supported only with public URL's ).
In my use case I will be using S3 Links to fetch the document and render them.
Since s3 links are private ( and we don't intend to change this ). What can I use to render the doc and docX type?

Is there any other alternative to those libraries ( free ) that I can use where It renders multiple file types?

Reference of roughly what I need to create.

🌐
GitHub
github.com › mengtaiqili › react-doc-viewer-plus
GitHub - mengtaiqili/react-doc-viewer-plus · GitHub
import { DocViewerPlus } from 'react-doc-viewer-plus'; function App() { const [visible, setVisible] = useState(false); return ( <DocViewerPlus previewFile={{ fileUrl: 'https://example.com/sample.pdf', fileName: 'Sample Document.pdf' }} visibleViewerPlus={visible} onVisibleChange={() => setVisible(!visible)} /> ); }
Author   mengtaiqili
🌐
Medium
medium.com › @pveerrotwal › documnet-viewer-using-mammoth-js-and-react-doc-view-9547fa1fa728
Document viewer using mammoth.js and react doc view | by Paramvir Rotwal | Medium
June 27, 2024 - This project provides a simple yet functional document viewer using React. The two implementations (mammoth.js and react-doc-viewer) offer flexibility based on your requirements. While mammoth.js is great for generating clean HTML, it has ...