Custom components
Register application-owned React components and use them directly in every MDX page.
Loading documentation…
Custom components let documentation use application-owned React UI without
adding an import to every MDX file. The preview above uses FlickeringGrid, a
canvas component copied from Paragraph and registered by this documentation
application.
The component is safe to render on the server: it emits an empty canvas during SSR and starts measuring, observing, and animating only after hydration.
Keep custom components in application code, then add them to the map passed to
DocsApp. The map key becomes the JSX tag that MDX can render.
Fenced code blocks preserve every newline as a hard line break, so the imports and component map below render exactly as written.
mdxComponents is runtime UI, so it belongs next to the framework shell rather
than in heyo-docs.config.ts. The same API is used by React Router, Next.js,
and Astro; each framework simply passes the map from the component that renders
DocsApp.
After registering it, use FlickeringGrid exactly like any built-in MDX
component. The source in the CodeSnippet is a complete example; tailor its
container and visual props to the page you are writing.