---
title: "React document viewer for Word, Excel, PPT | Nutrient Web SDK"
canonical_url: "https://www.nutrient.io/guides/web/viewer/office/react/"
md_url: "https://www.nutrient.io/guides/web/viewer/office/react.md"
last_updated: "2026-11-11T00:00:00.000Z"
description: "Learn how to seamlessly embed and display Office documents (Word, Excel, PowerPoint) in your React app using Nutrient Web SDK’s document viewer. Improve document accessibility and user experience with our powerful React integration."
---

# Embed Office documents in React

Nutrient Web SDK enables seamless client-side rendering of Word, Excel, and PowerPoint documents directly in [modern browsers](https://www.nutrient.io/guides/web/pspdfkit-for-web/browser-support.md), eliminating the need for external dependencies or Microsoft Office licenses. With our JavaScript Office document viewer, developers can quickly embed a customizable and responsive Office file viewer into any React-based web application, ensuring smooth integration and enhanced user experience.

[Try for free](https://www.nutrient.io/sdk/web/getting-started.md)

[Launch demo](https://www.nutrient.io/demo/office-viewer)



## Why build a React document viewer

Building a React document viewer offers several key advantages, particularly when aiming for a user-friendly and feature-rich experience:

- **Unified user experience** — Enables the seamless integration of multiple document types within a single, consistent interface, eliminating the need for end users to switch between different applications or plugins.

- **Enhanced interactivity and collaboration** — Facilitates the implementation of interactive features like annotations, highlighting, commenting, and real-time collaboration, directly within the viewer.

- **Improved performance and responsiveness** — Efficient rendering capabilities contribute to a smooth and responsive end user experience, even with complex documents.

- **Web-based accessibility and security** — Provides accessibility from any device with a browser, and when integrated within a secure web application, it can reduce the risk of document leakage compared to local file handling.

- **Customization and extensibility** — Enables developers to tailor viewer functionality to specific application requirements and add new features as needed.

## Key capabilities

- **Comprehensive file type support** — Open Word (DOCX, DOC, DOTX, and DOCM), Excel (XLSX, XLS, and XLSM), PowerPoint (PPTX, PPT, and PPTM), PDF, PNG, JPEG, JPG, TIFF, TIF (including multipage), and PDF/A (1, 2, 3, 4) files for seamless viewing.

- **Client-side document rendering** — All rendering and processing happens on the client, with no server dependency required.

- **Customizable user interface (UI)** — Adjust the interface to match your branding by adding or hiding buttons and controls.

- **Responsive design** — Enjoy a mobile-friendly document viewer that auto-adjusts to fit all screen sizes.

- **Accessibility features** — Fully compatible with assistive technologies to ensure inclusive usability.

- **Cross-browser compatibility** — Works seamlessly across all [modern browsers](https://www.nutrient.io/guides/web/pspdfkit-for-web/browser-support.md) and devices for broader reach.

- **Extendable features** — Convert documents to PDF to enable annotations, editing, and collaborative workflows.

- **Signatures** — Securely add electronic and digital signatures to PDF documents. Create, validate, and display digital signatures using our APIs. Enable hand-drawn eSignatures through an intuitive UI.

- **Comprehensive annotation support** — Access 17 annotation types, such as highlight, text, and ink. Create, edit, and delete annotations through APIs or the UI, and manage them with XFDF or JSON import/export and advanced styles such as cloudy borders.

- **Advanced form handling** — Fill forms, export or embed data, and create forms with drag and drop or APIs. Enable JavaScript-based validation for automated workflows.

- **Thumbnail rendering** — Render PDF pages as images for thumbnails, ideal for quick navigation or previews in viewer applications.

- **Bookmark and table of contents management** — Manage bookmarks and outlines with JavaScript or a customizable UI for hierarchical navigation and context-specific links.

- **Printing and downloading control** — Restrict printing and downloading with toolbar configuration, text annotations, and password protection for secure document sharing.

Viewing Microsoft Office and image files requires the [**Office Files and Image Documents components**](https://www.nutrient.io/sdk/features-list/) to be enabled in your license.






## Getting started

Integrate Nutrient Web SDK into your React project to begin using it. You can load Nutrient Web SDK directly from Nutrient’s content delivery network (CDN), which Nutrient maintains for its customers. Using the CDN is a quick and easy way to get started.

1. Add the following `<script>` tag in your `index.html`:

   ```html

   <script src="https://cdn.cloud.nutrient.io/pspdfkit-web@1.26.0/nutrient-viewer.js"></script>
   ```

2. You can now use Nutrient Web SDK and reference `window.NutrientViewer` in your client-side code.

If you need more control and flexibility, consider using a local installation. For detailed instructions, refer to the [getting started with React](https://www.nutrient.io/sdk/web/getting-started/react-vite.md#installation) guide.

## Opening Office files from a URL

To load a document from a remote URL in standalone mode, pass it in the [configuration](https://www.nutrient.io/api/web/NutrientViewer.Configuration.html) object passed to [`NutrientViewer.load()`](https://www.nutrient.io/api/web/NutrientViewer.html#.load):

```js

NutrientViewer.load({
  document: documentUrl
});

```

For more information, refer to our [open MS Office files from a URL](https://www.nutrient.io/guides/web/open-a-document/office-from-remote-url.md) guide. For information on alternate methods to open a document (blobs, ArrayBuffer, local storage, and more), refer to our [guides for opening a document](https://www.nutrient.io/guides/web/open-a-document.md#guides-for-opening-a-document).

## Converting Office documents to PDF

To convert an Office document to a PDF after displaying it in the viewer, follow the steps below.

1. [Load the source Office document](https://www.nutrient.io/guides/web/open-a-document.md) (optional). To load the document without a user interface visible to the end user, use the `headless` parameter.

2. Make changes to the document (optional). For example, [add annotations](https://www.nutrient.io/guides/web/annotations/create-edit-and-remove/create.md).

3. Convert the source document to a PDF with the [`exportPDF`](https://www.nutrient.io/api/web/NutrientViewer.Instance.html#exportPDF) method (optional). Use the `outputFormat` flag to create a PDF/A document. For more information, see [converting PDF to PDF/A](https://www.nutrient.io/guides/web/conversion/to-pdfa.md).

4. Save the output document. The `exportPDF` method returns a `Promise` that resolves to an `ArrayBuffer` containing the output PDF document. You can use the resulting `ArrayBuffer` to download or persist the output PDF in storage. For more information on downloading or persisting the exported `ArrayBuffer`, see the [guides on saving a document](https://www.nutrient.io/guides/web/save-a-document.md#guides-for-saving-a-document).

The following example loads an Office document and exports it to a PDF:

```js

NutrientViewer.load({
  container: "#nutrient",

  document: "source.docx",
  licenseKey: "YOUR_LICENSE_KEY"
}).then((instance) => {
  instance.exportPDF();
});

```

For more information, refer to our [convert Office to PDF in React](https://www.nutrient.io/guides/web/conversion/office-to-pdf/react.md) guide.

## Customizing the UI

Nutrient Web SDK’s React document viewer enables you to customize every part of the UI. Our robust API for configuring behavior and appearance lets you hide or add buttons, change the theme to match your look and feel, trigger workflows, create overlays, and much more. For more information, refer to our [guides for customizing the UI](https://www.nutrient.io/guides/web/user-interface.md#guides-for-customizing-the-ui).

## Adding zoom functionality

Nutrient Web SDK provides various UI elements and API helpers to manage zooming in and out of documents, as well as to handle zooming automatically. End users can zoom in and out using the toolbar buttons (`zoom-in` and `zoom-out`) or keyboard shortcuts:

- Control/Command + + — Zoom in

- Control/Command + - — Zoom out

- Control/Command + 0 — Zoom to auto

- Control + Scroll wheel — Zoom in or out at mouse position

For more information on configuring zoom behavior using an API or disabling zoom for annotations, refer to the [zoom options](https://www.nutrient.io/guides/web/viewer/zooming.md) guide.

## Adding fullscreen mode

Use the [fullscreen API](https://developer.mozilla.org/en-US/docs/Web/API/Fullscreen_API) to implement fullscreen mode. The following example demonstrates an approach that works across multiple browsers:

```js

function requestFullscreen(element) {
  if (element.requestFullscreen) {
    element.requestFullscreen();
  } else if (element.webkitRequestFullscreen) {
    element.webkitRequestFullscreen();
  }
}

requestFullscreen(nutrientContainer);

```

## FAQs

#### Do end users need Microsoft Office installed to view documents?

No, the viewer renders Office documents directly in the browser without requiring Microsoft Office.

#### Is it possible to restrict document interactions like editing or downloading?

Yes, you can configure permissions to disable editing, downloading, and printing based on your requirements.

#### Can I integrate the viewer with cloud storage like Google Drive or OneDrive?

Yes, you can load Office documents from cloud storage by fetching the file URL and passing it to the viewer.

#### Is there a free trial available for Nutrient Web SDK’s React document viewer?

Yes, you can try the viewer with a free trial before purchasing a license. Your free trial unlocks the full capabilities of our SDK and includes support from our solutions engineers.

#### How do I handle errors when loading Office documents in the viewer?

`NutrientViewer.load()` returns a `Promise` that rejects if the document fails to load. Catch the rejection to show an error message or retry.

**Call to Action**

Start your free trial for unlimited access and expert support.

[Learn More](https://www.nutrient.io/sdk/web/getting-started/react-vite.md)
---

## Related pages

- [Seamless document viewing with Angular SDK](/guides/web/viewer/office/angular.md)
- [Office document viewer for ASP.NET apps](/guides/web/viewer/office/aspnet.md)
- [Render Office documents in Blazor apps](/guides/web/viewer/office/blazor.md)
- [Powerful Electron Office viewer for all document types](/guides/web/viewer/office/electron.md)
- [HTML5 document viewing for web apps](/guides/web/viewer/office/html5.md)
- [Render Office documents in your web app](/guides/web/viewer/office/jquery.md)
- [View Office documents in Laravel](/guides/web/viewer/office/laravel.md)
- [View Office documents in Next.js apps](/guides/web/viewer/office/nextjs.md)
- [Embed an Office document viewer](/guides/web/viewer/office/nuxtjs.md)
- [Document viewing for PHP applications](/guides/web/viewer/office/php.md)
- [Office document viewing in web apps](/guides/web/viewer/office/rails.md)
- [Embed Office documents in TypeScript applications](/guides/web/viewer/office/typescript.md)
- [Client-side document viewer for Vue.js applications](/guides/web/viewer/office/vuejs.md)

