MDX Components for Modern Content Systems

A technical overview of reusable React components in MDX. Includes implementation examples for interactive content.

Overview

  • MDX extends Markdown with React components, enabling interactive content within static texts.
  • The recommended components: Tabs, Accordion, Charts, DataTable, Mermaid diagrams, Video embeds, Callouts, References.
  • Mermaid supports Flowchart, Sequence, Class, State, ER, User Journey, Gantt, Mindmap, Sankey, and Architecture diagrams.
  • An LLM guide describes the writing style, component selection, and publication checklist.

MDX extends Markdown with React components, enabling the seamless integration of interactive elements into static content. This architecture combines the simplicity of Markdown with the flexibility of modern frontend frameworks.


Table of Contents  


Part 1: Markdown Basics 

Headings  

Heading 1 

Heading 2  

Heading 3  

Heading 4

Heading 5
Heading 6

Text Formatting  

A paragraph with italic text, bold text and inline code.

This is a new paragraph with combined bold and italic text.


Abbreviations  

Abbreviations with tooltip explanations for better accessibility.

The HTML specification is maintained by the W3C. Modern websites use CSS for styling and JS for interactivity.

For SEO, semantic HTML is important. The API communicates via REST or GraphQL.

Tip: Hovering over the abbreviations shows the full meaning.


Language Spans  

Correctly marking up foreign language terms for screen readers and search engines.

The User Interface should offer a good User Experience. We follow the Don't Repeat Yourself principle (DRY).

The Pull Request was merged after the Code Review. The Deployment is carried out via Continuous Integration.

The Café serves Cappuccino and Croissants.

Advantages: Screen readers can choose the correct pronunciation, and search engines understand the linguistic context.


Lists  

Unordered List:

  • First item
  • Second item
    • Nested item
    • Another nested item

Ordered List:

  1. First step
  2. Second step
    1. Nested step
    2. Another nested step

A link to our website and a link with a title.


Blockquotes  

Block quotes are ideal for citations, key statements, or highlighted information.

Example 1: Simple Quote

This is a block quote. It can be used for quotes, important notes, or highlighted statements.

Block quotes can contain multiple paragraphs.

Example 2: Expert Quote

"The best way to predict the future is to invent it."

— Alan Kay, Computer Scientist

Example 3: Important Note

Important: Server Components in Next.js 15 require a strict separation between server and client code. Ensure that no browser APIs are used in Server Components.


Code Blocks  

Code blocks with syntax highlighting for various programming languages.

Inline Code: const x = 42 or npm install react

Example 1: TypeScript

Example 2: React Component (JSX)

Example 3: CSS Styling

Example 4: Shell Commands

Example 5: JSON Configuration

Markdown Syntax:


Part 2: Interactive UI Components 

Tabs  

Tabs structure related content and reduce initial page complexity.


Accordion  

Accordion pattern for FAQ sections and structured information architecture.


Progress Bars  

Visually represent skill levels, process progress, or performance metrics.

React / Next.js95%
TypeScript90%
TYPO3 / PHP85%
DevOps / Cloud80%

Timeline  

Present project milestones, release history, or development roadmaps in a structured manner.

Next.js 15 Migration

Upgrade to React Server Components and App Router.

Component Library Launch

Release of our internal component library.

MDX Integration

Implementation of MDX for content management.

Card Grid  

Cards for features, services, or structured information.

Performance

Server Components reduce JavaScript bundle size by up to 40%.

Type Safety

Full TypeScript integration with automatic type inference.

Developer Experience

Hot Module Replacement, ESLint, and Prettier support.


Tooltip  

Tooltips provide contextual information without interrupting the flow of reading.

Tooltips are particularly useful for technical abbreviations or technical terms.

Features: WCAG 2.1 AA compliant, keyboard navigation, touch support for mobile, smart positioning


Part 3: Data Visualisation 

Charts  

Interactive charts based on the Recharts library.

Line Chart  

Bar Chart  

Area Chart  

Pie Chart  

Props:

  • type: 'line' | 'bar' | 'area' | 'pie'
  • data: Array of data objects
  • xAxisKey: Key for the X-axis
  • lines/bars/areas: Array of data keys
  • dotShapes: Custom dot shapes ('circle', 'cross', 'diamond', 'square', 'star', 'triangle')
  • colors: Custom colour array
  • height, showGrid, showLegend, yAxisUnit

Data Tables  

Formatted tables with different variants.

Standard Markdown Table  

FrameworkTypeRenderingPerformance
Next.jsReactSSR/SSG/ISR
Nuxt 3VueSSR/SSG
SvelteKitSvelteSSR/SSG

DataTable Component  

MetricBeforeAfterImprovement
First Contentful Paint2.4s0.8s+67%
Largest Contentful Paint4.2s1.2s+71%
Time to Interactive5.8s2.1s+64%

Variants: default, striped, bordered, minimal


Comparison Tables  

Specialised tables for feature comparisons with boolean support.

FeatureTYPO3WordPressDrupal
Enterprise-Ready
Multi-Site Support
Fine-grained Permissions
Built-in Versioning
Learning CurveSteepEasyModerate

Part 4: Mermaid Diagrams 

Technical diagrams directly in MDX with lightbox functionality and WCAG-compliant colours.

All Mermaid diagram types

Mermaid.js supports 15+ diagram types. All of the important ones are documented here with examples.


Flowchart  

Visualise process and decision flows.

Next.js ISR (Incremental Static Regeneration) Flow

Directions: TD (Top-Down), LR (Left-Right), BT (Bottom-Top), RL (Right-Left)


Sequence Diagram  

Illustrate API interactions and request flows.

Server-Side Rendering Request Flow

Syntax: ->> (solid arrow), -->> (dashed), activate/deactivate for lifelines


Class Diagram  

UML class diagrams for software architecture.

Blog System Class Structure

Relationships: --> (Association), --|> (Inheritance), ..> (Dependency), --* (Composition)


State Diagram  

Workflow management and state machine modelling.

Content Publishing Workflow States

Syntax: [*] for start/end, --> for transitions with a label after :


Entity Relationship Diagram  

Documenting database schemas and data models.

Blog System Database Schema

Cardinalities: || (one), o{ (many), |{ (one or more), o| (zero or one)


User Journey  

Map out customer experience and conversion funnels.

Conversion funnel from first contact to customer

Syntax: section for phases, score (1-5) after task, actors after score


Gantt Chart  

Plan project schedules and milestones.

Project timeline with milestones

Status: done, active, crit (critical), milestone


Pie Chart (Mermaid)  

Visualise percentage distributions and statistics.

Browser distribution in web traffic

Option: showData displays percentage values, %%{init}%% for custom colours


Git Graph  

Visualise branching strategies and release flows.

Git branching strategy and release flow

Keywords: branch, checkout, commit, merge, tag, type: HIGHLIGHT


Mindmap  

Represent knowledge structures, brainstorming, and hierarchies.

Technology Stack Overview

Syntax: Indentation defines the hierarchy, root((Text)) for the central node.


Timeline (Mermaid)  

Chronological representation of events.

Web development over time

Syntax: section for time periods, Year : Event for entries


Quadrant Chart  

Four-quadrant analyses and prioritisation matrices.

Technology evaluation by impact and effort

Syntax: Axes with x-axis/y-axis, name quadrants 1-4, points as [x, y] (0-1)


Sankey Diagram  

Visualise flow distributions and resource allocation.

Web project budget allocation (in thousands of EUR)

Syntax: Source,Target,Value – defines flows between nodes

Beta Feature

Sankey diagrams are marked as beta in Mermaid. Syntax may change.


Architecture Diagram  

Visualise system architectures as a flowchart.

Modern web architecture

Syntax: subgraph for groups, TB (Top-Bottom), [()] for databases/cylinders


XY Chart  

Data relationships as a line or bar chart.

Performance optimisation over time

Syntax: x-axis, y-axis with ranges, bar and line for data series


C4 Diagram  

Software architecture at various abstraction levels (Context, Container, Component).

C4 System Context Diagram

Elements: Person, System, System_Ext, Container, Component, Rel for relationships


Requirement Diagram  

Visualise requirements and their relationships.

Security Requirements for Authentication

Note: Requirement diagrams use flowchart syntax for better MDX compatibility. Use subgraphs to group requirements and elements, with arrows showing relationships like satisfies, derives, etc.


Mermaid Summary  

Diagram TypeUse Case
FlowchartProcesses, algorithms, decision trees
SequenceAPI flows, service communication
ClassOOP structures, domain models
StateWorkflows, state machines
ERDatabase schemas
User JourneyUX flows, customer journey
GanttProject planning, timelines
PiePercentage distributions
Git GraphBranching strategies
MindmapBrainstorming, hierarchies
TimelineChronological events
QuadrantPrioritisation matrices
SankeyFlow visualisations
BlockSystem architectures
XY ChartData visualisation
C4Software architecture
RequirementRequirements engineering

Part 5: Media & Embeds 

Video Player  

HTML5 video for local video files – ideal for demos and tutorials.

Props: controls, poster, autoplay, loop, muted, preload


Clickable image galleries with lightbox functionality via React Context.

St Martin-in-the-Fields church portico with neoclassical columns

St Martin-in-the-Fields, London

Covent Garden Market hall interior with Victorian iron framework

Covent Garden Market

Covent Garden piazza at sunset with cobblestone square

Covent Garden Sunset

National Gallery at Trafalgar Square illuminated at dusk

National Gallery, Trafalgar Square

Nelson's Column at Trafalgar Square at dusk

Nelson's Column

Illuminated fountain at Trafalgar Square at night

Trafalgar Square Fountain

TYPO3 conference presentation slide about caching

TYPO3 Camp London Session

London Underground platform with red tube train arriving

London Underground

Features: Click-to-open lightbox, keyboard navigation (arrow keys, ESC), swipe on mobile, lazy loading, thumbnail support


YouTube Embed  

GDPR-compliant video integration without cookie tracking prior to user interaction.

Video abspielen
Lädt YouTube & setzt Cookies

Klick lädt YouTube (Datenschutz)

Features: react-lite-youtube-embed, youtube-nocookie.com domain, hover overlay with cookie warning


Twitter/X Quote  

Static tweet display without tracking or cookies.

Statisch gerendert - keine Cookies, kein Tracking

Features: 100% static HTML, zero cookies, instant rendering, link to original


GitHub Repository Card  

Server-side repo information without client-side API calls.

Features: Server Component, revalidation every 60 minutes, zero client JavaScript, ISR support


Audio & Music Embeds  

Simple embedding of Spotify and YouTube audio/video content.

Respect copyrights

Ensure that you have the rights to embed the content.

Spotify Embed  

Embed Spotify tracks, albums, playlists, and podcasts directly:

Further examples:

Props:

  • uri: Spotify ID (from the Spotify URL)
  • type: 'track' | 'album' | 'playlist' | 'episode' | 'show'
  • height: Height in pixels (optional)
  • compact: Compact mode with 80px height

YouTube Embed  

For video and audio content from YouTube, use the YouTubeEmbed component (see Video Player above).


Part 6: Content Structuring 

Callout Components  

Notes and highlights in 5 variants.

Information

Neutral information and technical details.

Success

Positive confirmations and successful operations.

Warning

Warnings and potential issues.

Error

Critical errors and breaking changes.

Technical Tip

Best practices and optimisation recommendations.

Types: info, success, warning, error, tip


TechResourceCallout  

Specialised callout for technical resources and developer documentation. Ideal for referencing GitHub skills, API documentation, or technical deep dives.

Für technisch Interessierte

Deepfake-Detection Skill

Documents forensic analysis methods in detail – from sensor fingerprints (PRNU/PCE) and compression artefacts to semantic forensics. Ideal for developers building detection pipelines.

Auf GitHub öffnen

Props:

PropTypeDefaultDescription
titlestringrequiredTitle of the resource
childrenReactNoderequiredDescription of the resource
urlstringrequiredURL to the resource (GitHub, Docs, etc.)
linkTextstring"Auf GitHub öffnen"Button text
headerstring"Für technisch Interessierte"Heading
iconstring"code"Lucide icon name

Further examples:

Für TYPO3-Administrator:innen

TYPO3 Security Hardening

Comprehensive checklist for secure TYPO3 installations, from file permissions and CSP headers to trusted hosts.

Dokumentation öffnen

PDF Download  

Uniform presentation for PDF downloads in three variants.

Default  

True or false on the internet?(2.3 MB)

Saferinternet.at teaching material

Compact (Inline)  

For inline use: Material as PDF(2.3 MB) – ideal for body text.

Card  

Complete teaching material(2.3 MB)

All 17 topics with exercises and background information.


Subpage Navigator  

Structured navigation to related subpages.


Part 7: References & Sources 

For scientific articles and extensive blog posts, we offer a system for managing citations and references – with automatic numbering and subheadings organised by chapter.

Database as Single Source of Truth

All references are managed in the PostgreSQL database. Within the MDX content, sources are referenced via their database ID (<Citation id="db-123" />). The reference list at the end of each article is rendered automatically by the blog wrapper via ArticleReferencesSection. New references are imported via scripts/sync-blog-references.ts or the admin interface.


AllReferencesFlat  

The database-based variant – loads references from the PostgreSQL database and displays them with subheadings.

Props:

PropTypeDefaultDescription
titlestring"Referenzen & Quellen"Section heading
descriptionstring-Optional introductory text
pageFilterstring-Filters by page path (optional)
classNamestring-Additional CSS classes

Advantages of the database variant:

  • Central management of all references
  • Search and filtering via API
  • Reuse of sources across articles
  • BibLaTeX-compatible schema

ReferencesSearch  

Interactive search interface for all references in the database.

Props:

PropTypeDefaultDescription
lang'de' | 'en''de'Language of the UI texts
showStatsbooleanfalseShow statistics panel
compactbooleanfalseCompact mode for blog embedding
variant'dark' | 'light''dark'Colour scheme
classNamestring-Additional CSS classes

Features:

  • Full-text search across descriptions and URLs
  • Filtering by categories (12 categories)
  • Filtering by articles/pages
  • Sorting (number, description, category)
  • Pagination

Database Import  

For the database-based components, references must be imported into the PostgreSQL database.

Data Format (BibLaTeX Schema)  

12 Categories  

IDNameDescription
officialOfficial SourcesGovernment documents, authorities, international organisations
academicAcademicUniversities, educational institutions, academic publications
researchResearchResearch repositories, preprints, conferences
technicalTechnical DocumentationAPI documentation, technical specifications
toolTools & SoftwareSoftware tools, platforms, code repositories
commercialCompanies & ProductsCompany websites, product pages, business resources
standardsStandards & SpecificationsTechnical standards, guidelines, best practices
newsNews & MediaNews articles, press releases
blogBlogs & OpinionsBlog posts, expert opinions, personal websites
videoVideo & MultimediaYouTube, podcasts, webinars, video platforms
communityCommunity & OrganisationsCommunity organisations, associations, non-profit institutions
otherOtherOther sources not assigned to any category

Import Commands  

API Access  

References can also be queried and created via the REST API:


When to use which component?  

ScenarioComponent
Inline citation in textCitation with database ID
Reference list at the end of the pageAutomatically via ArticleReferencesSection
Manual reference listAllReferencesFlat with pageFilter
Interactive source searchReferencesSearch
API integration for external tools/api/references

Part 8: Installation & Best Practices 

Dependencies  

Component examples for common scenarios  

Or as a CardGrid:

Pre-publication checklist  

Title: Descriptive, contains the main keyword
Meta description: 150-160 characters, value proposition
Introduction: Problem-solution in 2-3 sentences
Structure: Logical H2/H3 hierarchy
Visualisation: At least 1 diagram or chart
Code examples: Practically relevant, commented
Conclusion: Key takeaways + call-to-action
Gender-inclusive language: Applied consistently
Tone of voice: Confident, active, forward-looking

Resources  

For questions regarding implementation: office@webconsulting.at

Let's talk about your project

Locations

  • Mattersburg
    Johann Nepomuk Bergerstraße 7/2/14
    7210 Mattersburg, Austria
  • Vienna
    Ungargasse 64-66/3/404
    1030 Wien, Austria

Parts of this content were created with the assistance of AI.