popoverResolver, you can replace it with your own UI in any framework.
Quick start
No configuration needed for the default behavior — click a link and the built-in popover appears. To customize, add apopoverResolver to the links module:
Configuration
(ctx: LinkPopoverContext) => LinkPopoverResolution | null | undefined
Synchronous function called when a user clicks a link. Receives a context object and returns a resolution that determines which popover to show. Return
null or undefined to use the default popover.Resolver context
The resolver receives aLinkPopoverContext object with all information about the clicked link:
Resolution types
The resolver returns one of four resolution types. Returnnull or undefined to use the default popover.
default
Show the built-in link popover with URL display and edit controls.
none
Suppress the popover entirely. Use this when the resolver handles the click itself (navigation, opening a modal, logging, etc.).
custom
Render a Vue component inside the built-in popover shell. editor and closePopover are automatically injected as props alongside any props you provide.
editor, closePopover, and any additional props:
external
Mount framework-agnostic UI into a raw DOM container. Use this for React, Svelte, vanilla JS, or any non-Vue framework.
SuperDoc creates a positioned <div> element and passes it to your render function. You mount your UI into that container. Return a { destroy } callback for cleanup when the popover closes.
render function receives an ExternalPopoverRenderContext:
The popover automatically closes on click-outside and Escape key — matching the built-in popover behavior. Your
destroy callback is called in both cases.Framework examples
- React
- Vue
- Vanilla JS
Use With the React wrapper:
createRoot to mount a React component into the external container. Return destroy to unmount cleanly.Styling
External popovers use CSS custom properties with sensible defaults that match the built-in popover. Override them to match your design system.Shared popover variables
These apply to both the built-in popover and external link popovers:External link popover overrides
Override just the external link popover without affecting other popovers:
Example — dark theme for external link popovers:
sd-external-link-popover for direct CSS targeting:
Behavior
- Toggle off: Clicking a link while its popover is already open closes the popover.
- Click outside: Clicking anywhere outside the popover closes it.
- Escape key: Pressing Escape closes the popover.
- Focus: When a popover closes, focus returns to the editor.
- Error handling: If the resolver or
renderfunction throws, SuperDoc falls back to the default popover and calls theonExceptioncallback. - Cursor: The editor cursor moves to the clicked link position before the resolver runs.

