docx-editor

Features

What the editor edits, what it preserves untouched, and its current limitations.

@portone/docx-editor edits common DOCX body content while preserving document structures outside its editing surface.

This page is the user-facing support summary. API details live in Custom controls and Core API.

Supported features

AreaWhat you can do
Text formattingEdit bold, italic, strikethrough, underline, palette or custom HEX colors, highlight, fonts, and font size.
ParagraphsApply paragraph styles, alignment, indentation, line spacing, line breaks, and page breaks.
TabsInsert, paste, format, navigate, select, and align document tabs using the document's automatic interval and effective paragraph stops.
ListsCreate and edit common bullet and numbered lists, including nested levels.
TablesInsert and remove rows, columns, and tables; merge, split, resize columns and rows, format, vertically align, and pad cells. Long tables continue at safe row boundaries, repeating leading tblHeader rows.
ImagesInsert, paste, drop, select, and resize inline images.
HyperlinksCreate, change, remove, and open external links.
CommentsView anchored threads; create, edit, reply to, resolve, reopen, and delete plain-text comments.
Footnotes and endnotesView references and plain-text note bodies while editing surrounding text.
Headers and footersVisually preview the first section's plain-text first, even, and default stories, including decimal PAGE and NUMPAGES fields.
Content controlsEdit or lock supported text and table-cell controls.
ClipboardPaste supported character formatting, paragraphs, destination-matched heading styles, line breaks, links, and common lists. Unsupported web styling is reduced to readable text.
EditorUse built-in controls, selectable document zoom, read-only mode, undo and redo, keyboard navigation, and IME composition.

Keyboard shortcuts

Mod is Command on macOS and Control elsewhere.

KeysWhat happens
EnterSplits the paragraph, and the new paragraph keeps the original's formatting, as Word does. In an empty list item it leaves the list instead.
Shift+EnterInserts a line break.
Mod+EnterInserts a page break.
Mod+B, Mod+I, Mod+UToggles bold, italic, and underline.
Mod+Shift+XToggles strikethrough.
Mod+KOpens the link panel over the selection. With nothing to link it reports that it did nothing, so the browser keeps its own binding.
Mod+ZUndo.
Mod+Shift+Z, Mod+YRedo.
TabInside a table it moves to the next cell; in a list paragraph it increases the level; in an ordinary paragraph it inserts a document tab.
Shift+TabMoves to the previous cell, or decreases the list level.
ArrowLeft, ArrowRightMoves the caret across a laid-out tab as one step. Holding Shift extends the selection instead.
EscapeCloses an open panel, menu, or link card and hands focus back to the paper. It also hides tooltips until the pointer or focus moves.

Keys not listed here fall through to ProseMirror's base keymap, which covers ordinary caret movement, selection, and deletion. A keymap passed through the plugins prop sees events first, so an application can take over a binding such as Mod+K without replacing the editor.

Preserved content

ContentBehavior
Additional Word character formatting and character stylesExisting formatting that the editor does not display or edit is preserved.
BookmarksExisting bookmark ranges are preserved at their document positions but are not displayed or editable.
Document fieldsExisting fields in the document body are preserved but not displayed or editable.
Tracked changesExisting revision markup is preserved but not displayed or editable.

Current limitations

  • Uncommon list formats may be displayed as decimal numbers, and a new list requires an existing numbering part.
  • Tab leader glyphs and bar lines remain preserved in OOXML but are not drawn.
  • Visual page boundaries are approximate and may differ from Word or printed output.

Preservation

Content outside the supported editing surface is not silently discarded. Untouched package parts and document blocks are written back from their original XML, while placeholders retain structures the editor cannot safely model.

If a safe round trip cannot be guaranteed, import or export fails with a stable error code instead of returning a damaged document. Core API documents the package limits and the server parser requirements.

On this page