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.
| Prop | Type | Default | Required |
|---|---|---|---|
className | string | - | No |
defaultIsDark | boolean | false | No |
defaultThumbnailSidebarOpen | boolean | false | No |
fileName | string | - | No |
isDark | boolean | - | No |
onIsDarkChange | (isDark: boolean) => void | - | No |
rounded | boolean | false | No |
src | string | - | No |