@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
- Get the plugin in the dashboard (Editor). It has a 7-day free trial; see Licence and domains.
- Install it with the command the dashboard gives you. It needs React 19 or later:
- Render the editor in a container with a height:
- 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):
- 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
Does it also work with PowerPoint and Excel?
Does it also work with PowerPoint and Excel?
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").Do I need the licence key while developing?
Do I need the licence key while developing?
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).What if I only want to display the document?
What if I only want to display the document?
Add
readOnly. See How do I show a Word file read-only in React?.Related
- Editor plugin: every prop, event and method.
- Licence and domains.