1k

React DOCX Viewer

A React DOCX viewer component for rendering Word documents with page thumbnails, zoom, themes, comments, sections, and review-friendly layout. Legacy .doc support is limited and experimental.

The React DOCX Viewer is for contracts, proposals, reports, and internal docs where Word document structure matters more than plain text extraction. DOCX is the primary supported format; legacy .doc support is limited and experimental, and conversion to DOCX is recommended for best fidelity.

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.
  • Treat legacy .doc files as limited/experimental; convert them to DOCX when fidelity matters.
  • 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. Legacy .doc support is limited and experimental.

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