GEOAIOLLMO Team, Technical Writer

MDX Styling and Components Showcase

A comprehensive guide demonstrating various markdown styling and custom components available in MDX. Complete example of all possible frontmatter fields.

Last updated:

This post showcases all MDX styling capabilities and custom components available in our blog.

Basic Text Styling

Regular text is written like this. You can use bold text and italic text, as well as inline code. Of course, you can also use bold italic and strikethrough.

You can add external links or create internal links.

This is a blockquote. Use it to emphasize important information or showcase inspiring quotes.

It can span multiple lines too!

Lists

Unordered List

  • First item
  • Second item
    • Nested item 1
    • Nested item 2
      • Deeper nesting
  • Third item

Ordered List

  1. Step 1: Set up environment
  2. Step 2: Write code
  3. Step 3: Run tests
    1. Unit tests
    2. Integration tests
  4. Step 4: Deploy

Code Blocks

Basic Code Fences

// Basic Shiki syntax highlighting
interface User {
  id: number;
  name: string;
  email: string;
}

function greetUser(user: User): string {
  return `Hello, ${user.name}!`;
}

Using the Code Component

example.js
javascript
// Displays with filename and language badge
const calculateSum = (numbers) => {
  return numbers.reduce((acc, num) => acc + num, 0);
};

const numbers = [1, 2, 3, 4, 5];
console.log(calculateSum(numbers)); // 15
Terminal Commands
bash
# Install npm package
npm install @astrojs/mdx

# Start development server
npm run dev

Callout Components

Tables

FeatureSupportedDescription
Syntax HighlightingAutomatic code highlighting via Shiki
Custom ComponentsReact/Astro component support
MultilingualKorean/English support
SEO OptimizationJSON-LD structured data
Responsive DesignMobile-friendly layout

FAQ Component

Frequently Asked Questions

What is MDX?
MDX is a format that lets you use JSX within Markdown. It combines the simplicity of Markdown with the power of React components.
What tech stack does this blog use?
Built with Astro v5, MDX, React, and Tailwind CSS. Hosted on Vercel and written entirely in TypeScript.
How do I create custom components?
Create an Astro or React component and import it at the top of your MDX file. Components are automatically styled and SEO-optimized.
How does syntax highlighting work?
We use Shiki, which is built into Astro. Simply specify the language in your code fence and it will be beautifully highlighted automatically.

Horizontal Rules

You can use horizontal rules to separate content:


Images (Coming Soon)

Images will be automatically optimized through the Img component:

import Img from '@components/mdx/Img.astro';

<Img
  src="/images/example.jpg"
  alt="Descriptive text"
  width={800}
  height={600}
/>

Conclusion

This showcase demonstrates the main features available in our MDX blog:

Markdown Syntax - Headings, lists, links, blockquotes, tables ✅ Code Highlighting - Automatic syntax highlighting via Shiki ✅ Custom Components - Callout, Code, FAQ ✅ SEO Optimization - Automatic structured data generation for FAQs ✅ Responsive Design - Works perfectly on all devices