Skip to main content

Snippets

Put reusable MDX in a snippets/ (or _snippets/) folder and include it anywhere:
The extension is optional. A missing snippet file renders nothing and is recorded in the build report rather than failing the page. You can also use standard MDX imports for snippets and components:

Custom components

Ship your own React components as .jsx files in the repository and import them from any page:
React hooks are available in these components without imports.

Variables

Define values once in docs.json:
Then reference them anywhere in your content, including inside code fences:
Variable names use letters, digits, and hyphens. Referencing an undefined variable is a build error for that page. Projects without a variables block can use literal {{…}} freely.

Escaping braces

Bare {expression} in prose is MDX syntax and would normally fail to compile. Docs7 automatically retries such pages with braces escaped, so stray braces in prose survive. Inside code fences braces are always literal.