Build a custom UI
Keep SuperDoc's DOCX canvas while your application renders task-specific controls.
Build a custom UI when your product needs focused controls or workflows around a DOCX document. SuperDoc continues to render the document and handle editing. Your application renders the toolbar, panels, and other controls it needs.
A SuperDoc editor renders a DOCX document in the centre. A toolbar above it and a comments panel beside it are rendered by the application. Reactive state — selection, command state, and comments — flows out of the editor to those controls, and commands and document operations flow back in.
SuperDoc renders the document, layout, selection, and editing
Your comments panel
renders from the comments snapshot
state out — selection, command state, comments
actions in — commands and document operations
You can replace one surface or the complete interface. For example, keep the built-in toolbar while rendering your own
comments panel, or set ui: false and render every control yourself.
Choose the right surface
| You need to | Use |
|---|---|
| Choose which built-in surfaces render | Config.ui |
| Observe UI state and run Editor actions | superdoc.ui |
| Read or mutate an explicit document target | editor.doc |
| Decide which interactions are allowed | interaction |
These surfaces work together. Setting ui: { comments: false } removes SuperDoc's comments interface, but your custom
panel can still use superdoc.ui.comments. The interaction configuration decides whether that panel may read, write,
or resolve comments.
superdoc.ui is the controller. Import its types from superdoc/ui. React applications use the provider and hooks from
superdoc/ui/react, and Vue applications use the composables from superdoc/ui/vue. Each binding exposes the same
controller.
Try one custom control
Select text in the document, then choose Bold. The application-owned button observes the command's live state and executes the action through the same controller as SuperDoc's built-in toolbar.
- 1 Observe
enabled · active - 2 Render
disabled · aria-pressed - 3 Execute
executeAsync() - 4 Read outcome
boolean or receipt
The control follows one reusable pattern: observe state, render it, execute the action, and inspect the result. The custom UI example contains the complete runnable project.
Follow the core path
If this is your first custom UI, read these guides in this order:
- Build your first custom control and move Bold into your application.
- Keep commands and controls in sync as the selection changes.
- Build a custom toolbar with a toggle and value pickers.
- Add document controls for zoom and DOCX download.
Only the first guide is a prerequisite. It establishes the controller setup the rest build on, so you can stop after any step. Step 2 explains how command state stays in sync and asks you to change nothing; steps 3 and 4 each replace that setup's Editor code rather than the guide before it.
Steps 3 and 4 take the toolbar in different directions and are alternatives rather than a sequence: the custom toolbar owns the toolbar markup outright, while document controls keep SuperDoc's toolbar and remove only Zoom. Read both before combining them.
Choose a workflow
After the first control, choose only the workflows your product needs. These guides are independent unless a page names a prerequisite.
| Your application needs to | Guide |
|---|---|
| Own the comment thread list and actions | Comments |
| Own the queue for accepting or rejecting revisions | Track changes |
| Navigate and edit structured document fields | Content controls |
| Own a visual find and replace session | Search |
| Replace the menu shown for a pointer or keyboard interaction | Context menu |
| Show table actions that follow the active cell | Tables |
| Position an AI prompt beside selected text | Selection and position |
| Turn an application finding into a tracked suggestion | Review findings |
| Share one application action across multiple controls | Custom commands |
Use Dialogs and surfaces when your application only needs content in a SuperDoc-managed layer. Use Theming to apply product colors to SuperDoc UI.