Design System
MDX
Documentation

MDX Component Showcase

February 19, 2025
5 min read
Beginner
MDX Component Showcase
TL;DR

This post serves as a living documentation and visual test suite for all custom MDX components implemented in the portfolio. It demonstrates the visual hierarchy, typography, and interactive elements available for content creation.

Typography & Formatting

Standard Markdown elements are styled to match the theme.

Headings

Heading 1

Heading 2

Heading 3

Heading 4

Text Styles

  • Bold Text for emphasis.
  • Italic Text for nuance.
  • Inline Code for technical terms.
  • External Link for references.
  • Normal text

1. Alert Blocks

Special blocks for highlighting information.

Pro Tip: Info Block

Use this component for neutral notes, pro-tips, or general information that should stand out but isn't critical. It accepts a title prop and children content.

Critical Warning: Alert Block

Use this component for warnings, potential pitfalls, or critical information that requires user attention. It's styled with a red semantic color to signal importance.

Warning: Warning Block

Use this component for things to watch out for. It's styled with an orange semantic color.

Success: Success Block

Use this component for success states. It's styled with a green semantic color.


2. Step-by-Step Guides

The <StepByStep /> component visualizes sequential processes.

1

Initialize Project

Run `npm init` to create a new `package.json` file.
2

Install Dependencies

Install the core libraries required for the project.
npm install react react-dom framer-motion
3

Deploy

Push your changes to the main branch to trigger a deployment.

3. Code Blocks

Enhanced code blocks with language support, syntax highlighting, and a copy button.

lib/utils.ts
import { clsx, type ClassValue } from "clsx";
import { twMerge } from "tailwind-merge";

export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}

4. Concept Cards

Cards with icons to explain high-level concepts or tech stacks.

Microservices

Decoupled services that can be developed, deployed, and scaled independently.

Monolith

A unified model for designing a software application as a single unit.


5. Diagram Wrappers

A container for diagrams (like the ones built with CSS or SVGs) to give them a consistent frame and caption.

Client
HTTP
Server
System Architecture Diagram

6. Zoomable Images

Click the image below to enter fullscreen zoom mode. Pan/scroll supported.

Zoomable Avatar Example

7. Tables

Markdown pipe tables are rendered with a styled wrapper (needs remark-gfm in vite.config.ts + Table/Thead/Tbody/Tr/Th/Td mapped in lib/blog-content.tsx). They work with any markdown table syntax:

FeatureSyntaxNotes
Pipe tables| a | b |Requires remark-gfm
Alignment:--- left, ---: right, :---: centerApplies per column
Inline contentbold, code, linksAll markdown works inside cells
Long tablesauto overflow-x scrollMobile friendly

A table with aligned columns and mixed content:

ModelYearUsed (FR)Notes
a60002014~260€Best value entry
a64002019~500€Better AF, 2x price
a67002023~1100€Future upgrade target

If a table renders as plain text, check that remark-gfm is in the remarkPlugins list and the table components are mapped in the MDX provider.


Written by Ayman Ben Hajjaj

Data Engineer & Project Manager