2

DOCX Viewer

Render Word documents with document structure, sections, comments, and review-friendly layout.

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

"use client";

import { DocxViewerPreview } from "@/components/ui/docx-viewer";

export function DocxViewerExample() {
  return (
    <DocxViewerPreview
      src="/path/to/document.docx"
      defaultThumbnailSidebarOpen={false}
    />

Installation

pnpm dlx shadcn@latest add https://ui.extend.ai/r/docx-viewer.json

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
defaultThumbnailSidebarOpenbooleantrueNo
fileNamestring-No
isDarkboolean-No
onIsDarkChange(isDark: boolean) => void-No
roundedbooleanfalseNo
srcstring-No