@docx-editor.dev/react

Use the React DOCX editor, arrange packaged components, or build custom controls with hooks.

Install and mount

Install the adapter and its engine peer:

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

Import the stylesheet once and render <DocxEditor> 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>
  );
}

<DocxEditor> renders the title bar, menu, toolbar, navigation pane, hyperlink popover, context menu, and editable document.

Choose an API

TaskAPIGuide
Configure the packaged editor<DocxEditor> props and DocxEditorRefReact props
Arrange or replace chromeDocxEditor.Root, DocxEditor.Viewport, DocxEditor.Content, DocxEditor.ToolbarReact composition
Build custom controlsuseDocxEditor, useEditorState, useEditorCommand, useEditorEventReact hooks
Automate the open document@docx-editor.dev/editor-api/browserReact examples
Export Markdown or PDF, and printmenu.exportersExport, Print
Show tracked changes and comments@docx-editor.dev/pro/reactPro package

Limits

  • The adapter requires one shared copy of @docx-editor.dev/core.
  • Import the stylesheet once, and give the editor's parent a measured height.
  • In the Next.js App Router, load the editor with dynamic() and ssr: false from a client component. The "use client" directive alone does not disable server rendering. See Next.js.
  • Import components, hooks, and engine helpers from the package root. The package has no /ui, /hooks, or /dialogs subpaths.
  • Review comes from @docx-editor.dev/pro under the EigenPal Pro License. PDF conversion runs on your Node.js server and also requires the EigenPal Pro License.

Next steps