Jan 30, 2026 - 1 min read

Custom MDX layouts

Layout illustration

Two-column editorial layout

Use Grid and GridCell to combine narrative text and supporting media. This template includes a custom grid component registered in src/components/mdx.tsx so you can drop it into any MDX file.

Layout tip

Keep your main text in the first column and use the second column for supporting visuals, stats, or checklists.

Layout illustration
Drop media here for emphasis.

Registering custom components

src/components/mdx.tsx
1
2
3
4
5
6
7
8
9
import { createMdxComponents } from "@prose-ui/react";
import { SafeMdxRenderer } from "safe-mdx";
import { Grid, GridCell } from "@/components/grid";

export const mdxComponents = {
  ...createMdxComponents(),
  Grid,
  GridCell,
};
YN

Hi, I'm Mohamed Afifi. I'm a mobile engineer and founder based in Toronto 🇨🇦. I write deep dives and working systems for developers who value quality, iteration speed, and scalable codebases.