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
| Guide | Use it to | API |
|---|---|---|
| Appearance | Theme colors and dark mode | --doc-* CSS properties, colorMode |
| Layout | Arrange the editor and panels | DocxEditor.Root, .Toolbar, .Viewport, .Content |
| Toolbar | Change toolbar controls | Named parts, Toolbar.Slot, Toolbar.Group |
| Menus | Change menus | DocxEditor.Menu, DocxEditor.ContextMenu |
| Dialogs | Replace dialogs | definePopup(), popups |
| Tracked changes | Show tracked changes | Review module settings |
| Comments and review cards | Style review cards | DocxEditorReview parts |
| Document styles | Apply paragraph styles | useParagraphStyle() |
| Fonts | Load fonts | fonts, loadFonts() |
| Language and locale | Change labels and locale | LocaleProvider, locale |
| React hooks, Vue composables | Build your own control | useEditorCommand(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>
);
}<script setup lang="ts">
import { DocxEditor } from '@docx-editor.dev/vue';
import '@docx-editor.dev/core/styles/editor.css';
defineProps<{ bytes: Uint8Array }>();
</script>
<template>
<div class="docx-editor contract-workspace">
<DocxEditor.Root :document="bytes">
<DocxEditor.Toolbar>
<DocxEditor.Toolbar.Italic hidden />
</DocxEditor.Toolbar>
<DocxEditor.Viewport :style="{ height: '520px' }">
<DocxEditor.Content />
</DocxEditor.Viewport>
</DocxEditor.Root>
</div>
</template>Check requirements
- Render every control inside
DocxEditor.Root, which provides the editor. - Load
@docx-editor.dev/core/styles/editor.cssbefore 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
- Igloo: custom toolbars, menus, and styling.
- Contract redlining: suggestions and tracked changes.