Custom Components
How to create and register custom MDX components with the current setup.
Use this guide to add your own MDX components in the current DocuBook setup.
Current Flow
- Step 1: Create a custom component in lib/mdx
- Step 2: Register it in lib/mdx/index.ts
- Step 3: Merge custom and built-in components in lib/mdx-components.ts
- Step 4: Use your custom component in MDX
Folder Structure
Recommended structure for this flow:
mdx-components.ts
index.ts
Outlet.tsx
Callout.tsx
example.mdx
Notes
- Do not register custom components in
lib/markdown.ts. - Keep all custom component registration in
lib/mdx/index.ts. - Keep all MDX map composition in
lib/mdx-components.ts.
Last updated May 5, 2026