Introduction

Browser-based WYSIWYG DOCX editor for React and Vue 3, with tracked changes, comments, and an Office.js-shaped automation API.

docx-editor is a WYSIWYG DOCX editor for React and Vue 3. It parses OOXML, renders paginated pages, and saves DOCX in the browser. Browser editing needs no upload or conversion service.

Install an editor

Install an adapter and the engine:

npm install @docx-editor.dev/react @docx-editor.dev/core

Render the editor in a container with a height:

import { DocxEditor } from '@docx-editor.dev/react';
import '@docx-editor.dev/core/styles/editor.css';

export default function App() {
  return (
    <div style={{ height: '100vh' }}>
      <DocxEditor document="blank" />
    </div>
  );
}

To open and save files, continue with the quickstart. In server-rendered frameworks, mount the editor on the client only. See Installation.

Choose an integration

TaskPackagesGuide
Edit DOCX in a React or Vue app@docx-editor.dev/react or @docx-editor.dev/vue, plus @docx-editor.dev/coreQuickstart
Show tracked changes and commentsAdd @docx-editor.dev/proPro package
Edit from a server, worker, or agent@docx-editor.dev/editor-apiEditing API
Automate an open browser editor@docx-editor.dev/editor-api/browserEditing API
Convert DOCX to Markdown@docx-editor.dev/docx-to-markdownMarkdown export
Convert DOCX to PDF on Node.js@docx-editor.dev/docx-to-pdfPDF export

The editing API follows a documented subset of the Office.js object model. It does not claim full Office.js compatibility.

Which API for which job

Use the React or Vue adapter hooks, the review hooks, and DocxEditorReview from @docx-editor.dev/pro/react or @docx-editor.dev/pro/vue to build browser review controls. Use the editing API in @docx-editor.dev/editor-api for document automation. It follows the Office.js object model and runs in browser and server hosts.

TaskBrowser controls (React or Vue)Document automation
Comment on found texteditor.findMatches, editor.selectMatch, then useReview().commentbody.search, then Range.insertComment
Reply to a threaduseReview().reply(item, text)Comment.reply(text)
Record a tracked replacementSuggesting mode, then editor.exec({ type: 'replaceMatch', match, text })document.changeTrackingMode = 'TrackMineOnly', then Range.insertText(text, 'Replace')
Propose an AI rewrite as tracked changesprepareRewrite through DocxEditor.createBrowserprepareRewrite from @docx-editor.dev/editor-api/agent
Accept or reject a changeuseReview().accept(item) or useReview().reject(item)Revision.accept() or Revision.reject()
Open a change without scrollinguseReview().setActive(key, { reveal: false })Not applicable: no viewport
Highlight rangesuseHighlights(name, source, options)Not applicable
Custom review rail cardsDocxEditorReview with preset set to false, useReviewCardHeights, useStackedReviewPositions, and useReviewRailMetricsNot applicable
Comment-on-selection buttonDocxEditorReview.AddComment as a direct child of DocxEditorReview, or useEditorCommand('review.addComment')Not applicable
Page setup and paragraph dialogsDocxEditor.PageSetupDialog or DocxEditor.ParagraphDialogSection.pageSetup, and Paragraph properties such as alignment

For worked examples, see Task recipes.

Check packages and licenses

PackagePurposeLicense
@docx-editor.dev/reactReact adapter and hooksApache 2.0
@docx-editor.dev/vueVue 3 adapter and composablesApache 2.0
@docx-editor.dev/coreFramework-independent OOXML, layout, paint, and editor engineApache 2.0
@docx-editor.dev/editor-apiBrowser and server automation through a documented Office.js-compatible subsetEigenPal Pro License
@docx-editor.dev/docx-to-markdownDOCX to Markdown conversion with pages and mediaApache 2.0
@docx-editor.dev/docx-to-pdfDOCX to PDF conversion on Node.jsEigenPal Pro License
@docx-editor.dev/proTracked changes, comments, and custom nodesEigenPal Pro License
@docx-editor.dev/telemetryAnonymous diagnostics, metrics, and error reportingEigenPal Pro License
@docx-editor.dev/i18nShared interface translationsApache 2.0
@docx-editor.dev/fontsOpen-licensed substitutes for common DOCX default fontsApache-2.0 AND OFL-1.1 AND LicenseRef-GUST-Font-License
@docx-editor.dev/fonts-cjkOptional Chinese, Japanese, and Korean fallback fontApache-2.0 AND OFL-1.1

Compare EigenPal Pro License and support options on the pricing page. The Nuxt module is a private workspace package. External Nuxt apps follow the Nuxt guide.

Find a task guide

TaskGuide
Check feature support and round-trip behaviorDOCX fidelity
Change controls, colors, and dialogsCustomization
Connect an agent to a documentBuild a DOCX agent
Edit right-to-left documentsRight-to-left support
Configure Chinese, Japanese, and Korean textCJK text
Translate the interface@docx-editor.dev/i18n

Next steps