The controller exposes navigation helpers for the everyday cases (scroll a comment or a tracked change into view, step through review). For raw element-id navigation and cross-session tracking, the host SuperDoc and the editor exposeDocumentation Index
Fetch the complete documentation index at: https://superdoc-caio-pizzol-sd-3105-custom-xml-parts-api.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
scrollToElement and PositionTracker.
Comments and tracked changes
ui.comments.scrollTo(id) and ui.trackChanges.scrollTo(id) land on a specific entity. ui.trackChanges.next() and previous() advance activeId and return the new id, but they don’t move the viewport on their own. Pair them with scrollTo to navigate.
ui.trackChanges.scrollTo is story-aware: a tracked change in a header, footer, or footnote activates the right surface before alignment. ui.comments.scrollTo is body-scoped today; non-body comment scroll lands in a follow-up.
Generic viewport scroll
ui.viewport.scrollIntoView accepts the same target shapes the doc-API uses (entity address, text address, text target). Pair it with block and behavior:
not-mounted / not-ready reasons.
Navigate by element ID
scrollToElement takes any element ID: paragraph, comment, or tracked change: and scrolls to it. Use doc.extract() to get all IDs at once, or query.match for targeted lookups.
- RAG citations: store
nodeIdalongside embeddings, navigate on click - Cross-references: link to specific paragraphs from external UI
- Search results: scroll to the matching paragraph
- Cross-session addressing: IDs from DOCX-imported content survive reloads
Track nodes during edits
When users edit a document, stored positions can drift. UsePositionTracker so navigation targets stay stable within the current session.
Hyperlinks example
Best practices
- Use
ui.comments.scrollTo/ui.trackChanges.scrollTofor the everyday cases. They’re the shortest path and they activate non-body surfaces correctly. - Use
superdoc.scrollToElementwhen you have a stable element id fromdoc.extract()or the Document API (RAG citations, cross-references, search hits). - Use
editor.positionTrackerwhen you need to follow a node that moves during edits within the current session. - For cross-session use, store
nodeIdvalues (notsdBlockId: those regenerate on each open). - Handle missing targets gracefully: every API above returns
falseif the element no longer exists.

