States you’ll see
On a docs page, each attached diagram shows one of three states:- Synced (no label) — the SVG in your repo matches the current diagram.
- Behind — you’ve edited the diagram since the last push; the repo still has the old SVG.
- Not synced — the diagram has never been pushed. Your repo has no SVG file for it yet, so the page renders without it.
What a sync does
Sync opens (or updates) a pull request on your repo that:- Writes the rendered SVG to a sidecar path next to the MDX page.
- Leaves your MDX file untouched on the first attach (you reference the SVG yourself), or updates the existing reference on subsequent syncs.
Slots
Most pages have one diagram, which uses the slot namedefault. If you attach more than one diagram to the same page, give each a distinct slot (hero, architecture, data-flow) so their SVG filenames don’t collide.
When to sync
- Right after attaching a new diagram, so the page stops rendering without it.
- After edits, when the chip shows “behind.”
- Skip syncing if you’re still iterating and don’t want PR churn — bindings are safe to leave in the “not synced” state as long as you want.
Next
Projects
How DocDiagram organizes diagrams within a connected repo.