Status
<Snippet> is a stub component today. The file prop is accepted and the call site is forward-compatible, but content from _snippets/ is not yet inlined into the page. Full snippet resolution ships in Phase 4 alongside the OpenAPI parser (both touch the sync pipeline).
Usage (target API)
<Snippet file="_snippets/authentication.mdx" />When Phase 4 ships, this will inline the contents of _snippets/authentication.mdx from your repo at sync time. The reader sees the full content; the snippet file is the single source of truth.
<!-- _snippets/authentication.mdx (in the tenant's repo) -->
Add your API key to the `Authorization` header:
```bash
curl -H "Authorization: Bearer YOUR_KEY" https://api.example.com/v1/users
## v0 escape hatch: inline children
Until Phase 4 lands, you can pass content inline as children. This skips the `_snippets/` lookup entirely and just renders whatever you pass:
```mdx
<Snippet>
Add your API key to the `Authorization` header.
</Snippet>Add your API key to the Authorization header.
This is identical to writing the content inline — there's no reuse benefit. The point is that authoring <Snippet> calls today is forward-compatible: when Phase 4 ships, you can swap inline children for the file prop without rewriting the call sites.
Why this matters
Snippets are how Mintlify (and the rest of the static-site-generator world) handle content reuse — boilerplate authentication intros, common warnings, shared error tables. Manual copy-paste is the alternative, which drifts the moment you update one and forget the others.
CodivDocs' Phase 4 implementation will:
Walk the
_snippets/directory insidecontentRootduring syncStore snippet bodies in a separate Postgres table keyed by file path
Resolve
<Snippet file="...">references at render time by looking up the bodySupport template variable substitution via the
varsprop
Variable substitution (Phase 4)
When Phase 4 ships, the vars prop will let you template-fill snippets per call site:
<Snippet
file="_snippets/authentication.mdx"
vars={{ apiKey: "YOUR_KEY", baseUrl: "https://api.example.com" }}
/><!-- _snippets/authentication.mdx -->
Add your key to `{baseUrl}`:
curl -H "Authorization: Bearer {apiKey}" {baseUrl}/v1/usersThe {apiKey} and {baseUrl} placeholders get replaced with the values passed at the call site. The same snippet file can serve dozens of pages with different example values.
Props
| Prop | Type | Required | Description |
file | string | No (one of file or children) | Path to snippet file relative to repo root |
vars | Record<string, string> | No | Template variable substitutions (Phase 4) |
children | ReactNode | No (v0 escape hatch) | Inline content rendered as-is |