Skip to main content
To edit DOCX in the browser with JavaScript, use Doconda’s editor plugin (@doconda/editor): a React component you pass the file to, as a link or as a File. Users edit it in a full Word editor and save() gives you back the edited .docx. Everything happens in their browser: the file is not uploaded anywhere to be edited.

Steps

  1. Get the plugin in the dashboard (Billing → Editor plugin), with a 7-day free trial. See licence and domains.
  2. Install it with the command from the dashboard (it needs React 19 or later):
  1. Open the file. From a link:
Or from memory, for example the File from an <input type="file"> (a Blob, ArrayBuffer or Uint8Array also works):
  1. Get the edited file through a ref:
The file keeps the original’s name (or whatever fileName says). The ref also has bytes() (the bytes, not wrapped in a File), focus() and isDirty() (whether there are unsaved changes).
  1. Send it to your server:

Useful events

What it edits

Text and paragraph styles, fonts, colours, lists, tables, images, shapes, links, columns, header and footer, footnotes, comments, table of contents, find and replace, and print or save as PDF. Whatever the editor does not touch is saved as is.

FAQ

No. It is edited in the user’s browser. It only leaves it if you send it, for example from onSave.
No: it is a React component and needs React 19 or later.
Yes, from your server with POST /documents/{id}/versions. See editor plugin: save.

Keep reading