Installation
Install the DOCX editor in React or Vue, add the stylesheet, and set a client-only boundary for server-rendered apps.
Install packages
Install one adapter and the engine. Each adapter declares @docx-editor.dev/core as a peer and needs one shared copy.
npm install @docx-editor.dev/react @docx-editor.dev/corenpm install @docx-editor.dev/vue @docx-editor.dev/coreAdd optional packages as your app needs them:
| Package | Adds | License |
|---|---|---|
@docx-editor.dev/pro | Tracked changes, comments, and custom nodes | EigenPal Pro License |
@docx-editor.dev/editor-api | Office.js-compatible editing on a server or with an open editor. Install with @docx-editor.dev/core. | EigenPal Pro License |
@docx-editor.dev/fonts | Open-licensed substitutes for common DOCX default fonts | Apache-2.0 AND OFL-1.1 AND LicenseRef-GUST-Font-License |
Check runtime requirements
| Runtime | Supported versions |
|---|---|
| React | ^18 || ^19 |
| Vue | ^3.3 |
| Node.js (SSR, headless automation, build-time rendering) | ^20.16.0 || >=22.3.0 |
Text measurement needs a text shaper. On an older Node.js version the shaper does not start, and the engine reports the Node.js version as the cause. Browser-only apps do not need Node.js.
Add styles and a container
Import the stylesheet once and give the parent 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>
);
}<script setup lang="ts">
import { DocxEditor } from '@docx-editor.dev/vue';
import '@docx-editor.dev/vue/styles.css';
</script>
<template>
<div style="height: 100vh">
<DocxEditor document="blank" />
</div>
</template>- The stylesheet is required. The Vue stylesheet imports the same core stylesheet that React uses.
<DocxEditor>fills its parent. A parent without a height collapses, and the editor does not appear.- Your app does not need Tailwind or an icon font. The precompiled CSS uses the
.docx-editorscope.
For a complete load and save flow, see the quickstart.
Choose a framework setup
The editor uses the DOM to measure text, so it renders on the client only. Server-rendered frameworks need a client-only boundary.
| Framework | Boundary | Guide |
|---|---|---|
| Vite with React | None | Vite |
| Vite with Vue | None | Vite with Vue |
| Next.js | dynamic() with ssr: false | Next.js |
| Remix | Mount check and React.lazy | Remix |
| Astro | React island with client:only | Astro |
| Nuxt | .client.vue component | Nuxt |
Test a canary build
Canary builds publish each night from main when it has unreleased changes that passed CI. They have no support guarantee. Use the canary tag on every @docx-editor.dev package in your app:
npm install @docx-editor.dev/react@canary @docx-editor.dev/core@canary- A canary version looks like
2.35.0-canary.20261103032300.sha-b20ba9f: next release, UTC build time, and source commit. - The packages of one canary pin each other to that exact version. Install every package from the same tag.
- Version ranges such as
^2.34.0never select a canary.
Next steps
- Quickstart: Load, edit, and save a
.docx. - Fonts and measurement: Load fonts for accurate line and page breaks.
- Editing API: Edit documents without a browser.