Skip to main content
Install Doconda’s editor plugin (@doconda/editor) and render <DocondaEditor src={url} /> in a container with a height. Users open the .docx, edit it and save it inside your site, and you get the edited file as bytes. The file is opened and edited in the browser: it isn’t uploaded anywhere to be edited.

Steps

  1. Get the plugin in the dashboard (Editor). It has a 7-day free trial; see Licence and domains.
  2. Install it with the command the dashboard gives you. It needs React 19 or later:
  1. Render the editor in a container with a height:
  1. Get the edited file through a ref:
src is a .docx the browser can download: from your site, or from a server that allows it with CORS. If you already have the file in memory (for example, from an <input type="file">), pass it in file with its name in fileName.

Save without losing changes

onSave receives the bytes when the user saves (Ctrl/Cmd+S or File → Save):
Behavior to be aware of:
  • While editing, the editor keeps a recovery copy in the browser for 7 days and offers it back if the tab closed without saving. autosave={false} turns it off.
  • Closing or reloading the page with unsaved changes asks for confirmation. warnOnClose={false} turns it off.
  • Whatever the editor doesn’t touch is saved as is: styles, charts and parts of the file it can’t edit are kept.

What it edits in a Word file

Text and paragraph styles, fonts, colours, lists, indents, line spacing, borders and shading, tables, images, shapes, text boxes, links, columns, header and footer, footnotes, comments, table of contents, and find and replace. It also prints and saves as PDF (save("pdf")).

FAQ

Yes, the same component opens .docx, .pptx and .xlsx. The format comes from the link’s extension; if it has none, pass format ("word", "slide" or "cell").
No. On localhost, 127.0.0.1 and *.localhost the editor always opens, with or without a key, and shows a “development licence” notice. In production it opens only on your licence’s domains (up to 5, https only).
Yes. toolbar picks which buttons appear, in what order and when (@table shows a group only while a table is selected), and false in statusBar or contextMenu removes those parts. See Customize.