docx-editor
Open-source WYSIWYG .docx editor for React and Vue with canonical OOXML, tracked changes, real-time collaboration, and an Agent API for AI-driven document editing.
At a Glance
Fully free under the Apache 2.0 license. No usage limits, watermarks, or premium tiers.
Engagement
Available On
Alternatives
Listed May 2026
About docx-editor
docx-editor is an open-source WYSIWYG .docx editor library built by EigenPal, designed to run entirely in the browser without any backend. It uses OOXML as the canonical format throughout — no intermediate HTML serialization — so documents round-trip through Word, LibreOffice, and Google Docs without quality loss. The project is released under the Apache 2.0 license and published on npm under the @eigenpal scope.
What It Is
docx-editor is a JavaScript/TypeScript component library that lets developers embed a full-featured Word-compatible document editor into React or Vue 3 applications. Unlike editors that convert DOCX to HTML for editing and back again, docx-editor keeps OOXML as the internal representation at all times. This means tracked changes serialize to w:ins/w:del, comments serialize to comments.xml with w:commentRangeStart/w:commentRangeEnd markers, and the resulting .docx file opens correctly in Microsoft Word with full accept/reject UI intact.
The library is structured as a monorepo of focused packages:
@eigenpal/docx-editor-react— React adapter with toolbar, paged editor, and plugins@eigenpal/docx-editor-vue— Vue 3 adapter (beta), parity-tested against React@eigenpal/nuxt-docx-editor— Nuxt 3 & 4 module wrapping the Vue adapter@eigenpal/docx-editor-core— Framework-agnostic OOXML parser, serializer, and layout engine@eigenpal/docx-editor-agents— Agent SDK, MCP server, AI SDK adapters, and chat UI components@eigenpal/docx-editor-i18n— Shared locale strings for both adapters
The Agent API
The Agent API is a first-class feature of docx-editor, shipped as the @eigenpal/docx-editor-agents package. It provides a Word JS API-shaped bridge that lets AI agents read and write .docx documents — either inline inside a live editor session or headlessly on the server.
Two transport modes:
- Inline (browser): The
useDocxAgentToolshook wires agent tool calls directly to a mounted<DocxEditor>instance. Paired with the Vercel AI SDK'suseChat, LLM-generated tool calls execute in the browser and the user sees tracked changes and comments appear in real time. - Headless (server):
DocxReviewer.fromBuffer()processes a.docxbuffer without a DOM, making it suitable for server-side pipelines, CI workflows, or batch LLM processing.
MCP server: The package ships a built-in MCP (Model Context Protocol) server, making the tool catalog available to any MCP-compatible agent runtime. The site also publishes /llms.txt and /llms-full.txt for LLM context discovery.
Why it matters for agents: Because tracked changes and comments are native OOXML, an AI agent can write w:ins/w:del/w:comment markup directly into a document and hand it to <DocxEditor /> for human review. No custom diff format, no proprietary API — the agent's output is immediately reviewable in Word or LibreOffice.
A drop-in <AgentPanel>, <AgentChatLog>, and <AgentComposer> UI kit ships with the React adapter for building side-by-side editor + chat interfaces.
Collaboration and Tracked Changes
Real-time collaboration is built on Yjs. Binding <DocxEditor> to a Yjs document enables live multi-user editing with shared cursors, presence, and conflict-free merging. The provider is user-supplied — y-webrtc works with zero infrastructure; PartyKit, Liveblocks, and Hocuspocus are supported for production deployments.
Tracked changes use suggestion mode: every edit in suggesting mode becomes a tracked insertion or deletion with author attribution. Consecutive keystrokes group into a single change. Accept or reject individually or in bulk via the toolbar. The same tracked-changes state syncs across collaborators once Yjs is wired up.
Comments are threaded, anchored to text ranges, and displayed in a Google Docs-style sidebar. They support reply, resolve, reopen, and delete. Comment state is managed via comments and onCommentsChange props and can be mirrored to a Y.Array for live sync.
Framework Support and Setup Path
The React adapter works with Vite, Next.js (App Router and Pages Router), Remix, and Astro. For Next.js, the component must be client-only ('use client' or next/dynamic with ssr: false) because ProseMirror requires the DOM at mount. The Vue adapter works with Vite and Nuxt; the Nuxt module auto-imports an SSR-safe <DocxEditor> without requiring a manual <ClientOnly> wrapper.
The plugin system is built on ProseMirror plugins and supports custom toolbar actions, keyboard shortcuts, and document transformations. The i18n system ships with English, German, Polish, Brazilian Portuguese, Turkish, Hebrew, and Simplified Chinese locales, with community contributions welcome.
Update: v1.0.2 and the 1.x Monorepo
The 1.x release series shipped with Vue support, i18n, and the agents package — a significant expansion from the 0.x monolith (@eigenpal/docx-js-editor, now in archive mode). The latest release as of the available sources is @eigenpal/docx-editor-agents@1.0.2, published in May 2026. The migration from 0.x to 1.x is described as a single find-replace codemod with a moved-symbol map in the migration guide. A live preview of the main branch is continuously deployed at latest.docx-editor.dev.
Community Discussions
Be the first to start a conversation about docx-editor
Share your experience with docx-editor, ask questions, or help others learn from your insights.
Pricing
Open Source
Fully free under the Apache 2.0 license. No usage limits, watermarks, or premium tiers.
- WYSIWYG .docx editing in the browser
- Tracked changes and comments
- Real-time collaboration via Yjs
- Agent API (inline and headless)
- MCP server
Capabilities
Key Features
- WYSIWYG .docx editing in the browser
- Canonical OOXML — no intermediate HTML serialization
- Tracked changes (w:ins / w:del) with author attribution
- Threaded comments anchored to text ranges
- Real-time collaboration via Yjs (y-webrtc, PartyKit, Liveblocks, Hocuspocus)
- Agent API: inline and headless modes
- MCP server for agent tool catalog
- Vercel AI SDK integration
- useDocxAgentTools hook for live editor agent wiring
- DocxReviewer.fromBuffer() for headless server-side processing
- AgentPanel, AgentChatLog, AgentComposer UI components
- React and Vue 3 adapters
- Nuxt 3 & 4 module
- Plugin system via ProseMirror
- Template variable insertion system
- Built-in i18n (8 locales)
- Pixel-perfect OOXML rendering: fonts, colors, images, tables
- Ref methods: save(), getDocument(), setZoom(), scrollToPage(), print()
- Zero backend required — fully client-side
- Round-trip fidelity with Word, LibreOffice, Google Docs
