277

React DOCX Viewer

A React DOCX viewer component for rendering Word documents with page thumbnails, zoom, themes, comments, sections, and review-friendly layout.

The React DOCX Viewer is for contracts, proposals, reports, and internal docs where Word document structure matters more than plain text extraction.

Installation

pnpm dlx shadcn@latest add @extend/docx-viewer

Useful behaviors

  • Preserve headings, lists, tables, images, headers, footers, and page breaks.
  • Expose document outline and section anchors.
  • Support comments, tracked-change surfaces, and copyable text.
  • Provide a predictable fallback state for unsupported Word features.

API Reference

DocxViewerPreview

The DocxViewerPreview component renders a DOCX file with upload, theme, and zoom controls around the @extend-ai/react-docx viewer.

PropTypeDefaultRequired
classNamestring-No
defaultIsDarkbooleanfalseNo
defaultThumbnailSidebarOpenbooleanfalseNo
fileNamestring-No
isDarkboolean-No
onIsDarkChange(isDark: boolean) => void-No
roundedbooleanfalseNo
srcstring-No