Extend UI Svelte

Docs / Viewers / DOCX Viewer

DOCX Viewer

Svelte 5 port of the Extend UI docx-viewer. Rendering runs on the client through the docx engine wrapper (docx-preview); the thumbnail sidebar is virtualized.

Page of -
50%

Differences from upstream

  • Upstream exports only DocxViewerPreview; every upstream export is available here.
  • Exported as both DocxViewer and the upstream name DocxViewerPreview; className and class are both accepted.
  • Pages render with docx-preview instead of @extend-ai/react-docx (React-only): comments, tracked changes, and the outline/section anchors are not shown.
  • The thumbnail sidebar lists page numbers with text excerpts instead of canvas page images, and stays inline instead of collapsing into an overlay on narrow widths.
  • defaultZoom takes the same values (default 50). The fit modes are resolved from the first page; "automatic" fits the width but never enlarges past 100%.
  • docx-preview builds the DOM for every page. Pages away from the viewport skip layout and paint through content-visibility: auto, instead of upstream's windowed page rendering.
  • The page number is editable like upstream; the Previous and Next page buttons are a port addition.
  • Hyperlinks keep only http, https, mailto, tel, and # targets; any other target is removed, so the link shows as plain text. Picture sources keep only embedded data:image and blob: URLs. Scripts, frames, embedded objects, and event-handler attributes in the rendered document are stripped.
  • toolbarActions is a Svelte snippet instead of a React node.
  • Legacy .doc files are accepted by the upload input, but docx-preview cannot render them; convert them to DOCX.

Back to all components