Customization

Overview

Customize the DOCX editor with CSS themes, React and Vue controls, document styles, fonts, and review cards.

Customize the editor interface with CSS tokens, named parts, and hooks. Start with the smallest change that works.

Choose a customization API

GuideUse it toAPI
AppearanceTheme colors and dark mode--doc-* CSS properties, colorMode
LayoutArrange the editor and panelsDocxEditor.Root, .Toolbar, .Viewport, .Content
ToolbarChange toolbar controlsNamed parts, Toolbar.Slot, Toolbar.Group
MenusChange menusDocxEditor.Menu, DocxEditor.ContextMenu
DialogsReplace dialogsdefinePopup(), popups
Tracked changesShow tracked changesReview module settings
Comments and review cardsStyle review cardsDocxEditorReview parts
Document stylesApply paragraph stylesuseParagraphStyle()
FontsLoad fontsfonts, loadFonts()
Language and localeChange labels and localeLocaleProvider, locale
React hooks, Vue composablesBuild your own controluseEditorCommand(slotId), useEditorState(selector)

Change one control

This toolbar keeps the preset and hides the italic button.

import { DocxEditor } from '@docx-editor.dev/react';
import '@docx-editor.dev/core/styles/editor.css';

export function Editor({ bytes }: { bytes: Uint8Array }) {
  return (
    <div className="docx-editor contract-workspace">
      <DocxEditor.Root document={bytes}>
        <DocxEditor.Toolbar>
          <DocxEditor.Toolbar.Italic hidden />
        </DocxEditor.Toolbar>
        <DocxEditor.Viewport style={{ height: 520 }}>
          <DocxEditor.Content />
        </DocxEditor.Viewport>
      </DocxEditor.Root>
    </div>
  );
}

Check requirements

  • Render every control inside DocxEditor.Root, which provides the editor.
  • Load @docx-editor.dev/core/styles/editor.css before your own CSS.
  • Hiding a control does not change operation permissions.
  • Interface styling changes controls only. Document styles and fonts can change pagination.
  • Review customization requires the review module and an EigenPal Pro License.

Explore complete examples

See also