useSuperDocUI() and the per-domain hooks. Drop your toolbar, sidebar, and review components anywhere inside the provider.
Install
Wire the provider
Wrap your app in<SuperDocUIProvider>. Mount <SuperDocEditor> somewhere inside. Hand the SuperDoc instance to the provider on onReady.
hideToolbar and contained keep <SuperDocEditor> from rendering its built-in toolbar or claiming the page. Your components own the layout.
Read state from a hook
Hooks return live state. The component re-renders only when the slice it subscribed to changes.What’s available
What the provider does
createSuperDocUI({ superdoc }) runs once when the editor reports ready. It tears down on unmount. You don’t manage the lifecycle.
Common pitfalls
Built-in UI overlapping with yours
Built-in UI overlapping with yours
Set
modules: { comments: false } on <SuperDocEditor> to disable SuperDoc’s built-in comment bubble. Same pattern for modules: { trackChanges: { ... } } if you want the engine without rendering. The Document API and exports keep working either way.Ready vs not-ready states
Ready vs not-ready states
useSuperDocUI() returns null between mount and onReady. Hooks downstream (useSuperDocCommand, useSuperDocComments, etc.) return their fallback states during that window. Your buttons render disabled, your sidebar shows empty. No flicker, no errors.Multiple editors
Multiple editors
One
<SuperDocUIProvider> holds one controller. If you render two editors on a page, give each its own provider.
